-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New build system (including 3rd party languages) #2312
New build system (including 3rd party languages) #2312
Conversation
My plan is to do this in two steps... Switch CDN/browser with one release, then finish up [NPM] with a second release... that second release is where we'd simplify There might also be a blocker with: Not sure. |
I do use
Perhaps there is a The new header:
|
This will require some time to get grasp of the changes. I can't promise to do it quickly, although I'll try to find time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now just some comments.
Also:
- On
export default
. We should mention it indocs/language-contribution.rst
. And what about language definitions in separate repos, are they also supposed to use it? - Is
roll.js
used at all? It looks like a first attempt that wasn't deleted.
How does it feel overall though? Does it seem clear and easy to follow at a big picture/high level? I just wanted to make sure it's making sense before I throw more time at it. |
At a high level it looks pretty clear and certainly makes sense. Just requires some polishing. |
Perfect. I'll circle back and get out my polish tools, and then ping you again later. |
8c4fafb
to
9268eb0
Compare
@egor-rogov You want to take another look at this now, it's a lot more polished I think. I'm still waiting for more feedback on: But really that only affects the actual detection of third party language packages (external_language.js)... and I've tried to keep all that bottled into a single place. |
Yeah, I'm going to, but have to find a big enough time quantum... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally everything looks good for me, but see some comments.
8169640
to
0f84777
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one unresolved question, but it's not that big a deal. The green light to the new build system (:
(For the future, I'd prefer several smaller PRs, 'cause it's much easier to move in smaller steps...)
Agree, but so much of it was interconnected and the plan came together as it happened. I see this as a pretty unusual type thing though in its complexity... should be simpler things in the future. :-) |
* + support for multi-language 3rd-party packages
6006a80
to
c833ecb
Compare
* new build process for brownser/cdn/node * detect 3rd party languages * can run markup tests in 3rd party bundles * can run detect tests for 3rd party bundles * remove gear/bluebird dependencies * add readme and license to CDN build * CDN embeds no languages vs all if no languages are passed in the list * change lib/highlight to lib/core for requiring the lib * (chore)package CDN for NPM * .min now, not .pack Co-authored-by: Eric Prud'hommeaux <eric+github@w3.org>
The idea: Simplify the build process (that currently uses gear) to simple pure JS (with minimal dependencies) that is easy to read and understand.
Closes #2101.
Closes #2061.
Closes #2234
Closes #1425
Related #1759.
Should close #2328 also.
Closes #2334.
High level overview:
tools/rollup_browser.js
- New build script for Browsertools/rollup_cdn.js
- New build script for CDNtools/build.js
to hook the new CDN and Browser builds into the old Gear systemtools/lib
(some utils/tools that the new build scripts depend on)This directly integrates Rollup, Terser, and CleanCSS for the minification, ES6 module support (all the languages are now ES6 modules), etc.
browser
(before the Gear stub) is < 126 lines.cdn
(before the Gear stub) is < 64 lines.The idea is clean and readable code that hopefully explains itself.
Building the
browser
build:Installing demo:
The build output looks something like (depending on build):
The most complex high level code is
buildBrowserHighlightJS
, but I think that's understandable since this is the code building the full browser package really.The dependency stuff is also a bit verbose (and probably could use a simpler algorithm)... but it works and is well isolated in
lib/dependencies.js
, so I think it's ok for now.