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
chore: use rollup instead of webpack and esbuild #1701
Conversation
We want all these combinations? |
reporter: "spec", | ||
spec: "./lib/test/**/*spec.js" | ||
spec: "./test/**/*spec.ts" |
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.
The "build tests and source first, then run built tests" seemed a bit awkward. Also it had problems with wrong source lines in stack traces.
This runs the .ts spec files directly on the .ts source. This should have the advantage that the coverage report is more useful as it applies to the the .ts source. Also fix-coverage-report shouldn't be necessary anymore (?)
Separating the bundling and compilations steps was done intentionally. I see the following issues: Issues / ConsMajor: (not working correctly)
Minor (possible concerns)
Pros
|
"sinon": "11.1.2", | ||
"sinon-chai": "3.7.0", | ||
"webpack": "5.59.1", | ||
"webpack-cli": "4.9.1", | ||
"ts-node": "^10.4.0", |
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.
I think these deps are no longer needed (from previous version with mocha + tsnode)
name: "chevrotain", | ||
exports: "named" | ||
})), | ||
external: Object.keys(pkg.dependencies), |
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.
Should not we include everything in the bundle?
{ | ||
input: "src/api.ts", | ||
output: [ | ||
["es", false, true], |
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.
what do these combination mean?
terser({ | ||
compress: { | ||
passes: 3, | ||
unsafe: true, |
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.
How do we know everything works after bundling particularly when using unsafe
minification modes? what benefit does unsafe
produce in the bundle size?
compress: { | ||
passes: 3, | ||
unsafe: true, | ||
ecma: 7 |
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.
ecma 7 means ECMAScript 2017? or 2016?
anyhow we are officially targeting ECMAScript 2015, so this does not seem to make sense.
My initial impression is is that there are more cons to replacing the A possible hybrid approach would be to, combine bundle + tsc compile, but only for the web bundles. Long TermComparing the configuration complexity of rollup versus esbuild does make suspect I would prefer in the long term to use esbuild (once it supports UMD output natively). Basically if we can get x10 faster bundling with only two extra scripts in the package.json, It seems better than having a whole extra config file to me 😄 |
The big pro here is that the ES bundle works correctly now: It does Additionally the amount of custom scripts is reduced, which is good for maintability. |
I completely agree. I just wonder if we should (in mid term):
See more on this topic here: |
Technical discussion on supporting dual style libraries (CJS/ESM). |
@NaridaL I appreciate the effort you've put into this PR. 👍 This in no way means this PR is "waste effort", rather it is quite possible the main benefit of this PR My thoughts at the moment is that we may even be able to drop all bundled artifacts if we can switch to an ESM
Could be achieved at the cost of breaking CJS support. The main question is how stable would the eco-system support for ESM be in the mid term? WDYT? |
I am closing the PR for now with the hope that in ~7 months when nodejs 14 reaches EOL |
No description provided.