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
Modernize references to Node.js and webpack #3937
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3937 +/- ##
=======================================
Coverage 97.18% 97.18%
=======================================
Files 188 188
Lines 6681 6681
Branches 1944 1944
=======================================
Hits 6493 6493
Misses 99 99
Partials 89 89 Continue to review full report at Codecov.
|
README.md
Outdated
@@ -65,7 +65,7 @@ rollup main.js --format umd --name "myBundle" --file bundle.js | |||
|
|||
Developing software is usually easier if you break your project into smaller separate pieces, since that often removes unexpected interactions and dramatically reduces the complexity of the problems you'll need to solve, and simply writing smaller projects in the first place [isn't necessarily the answer](https://medium.com/@Rich_Harris/small-modules-it-s-not-quite-that-simple-3ca532d65de4). Unfortunately, JavaScript has not historically included this capability as a core feature in the language. | |||
|
|||
This finally changed with ES modules support in JavaScript, which provides a syntax for importing and exporting functions and data so they can be shared between separate scripts. The specification is now implemented in all major browsers and in Node.js behind the --experimental-modules flag for ".mjs" files. Rollup allows you to write your code using this module system, either outputting optimized ES modules for use in these native environments, or compiling it back down to existing supported formats such as CommonJS modules, AMD modules, and IIFE-style scripts. This means that you get to *write future-proof code*, and you also get the tremendous benefits of... | |||
This finally changed with ES modules support in JavaScript, which provides a syntax for importing and exporting functions and data so they can be shared between separate scripts. The specification is now implemented in all major browsers and in Node.js. Rollup allows you to write your code using this module system, either outputting optimized ES modules for use in these native environments, or compiling it back down to existing supported formats such as CommonJS modules, AMD modules, and IIFE-style scripts. This means that you get to *write future-proof code*, and you also get the tremendous benefits of... |
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 removal of the flag is only true for Node 14. Since Rollup supports LTS, this should stay in, or be modified to state that the flag may be required for older versions.
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.
This flag was also removed in 12.17.0: https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V12.md#2020-05-26-version-12170-erbium-lts-targos
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.
Right, but not 12.x prior to that and not 10.x both of which are still in LTS https://nodejs.org/en/about/releases/ We won't be able to remove that bit until April 2022. So, it should be reinstated or reworded.
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 have updated the Node.js version range, and I could not resist changing some of the surrounding text. I have tried to clarify why compiling to other formats is a feature. I have tried to make the problem -> solution structure more explicit, give concrete examples of environments that do not support ES modules. I have also tried to use to the same word (ES modules) instead of alternating (ES modules - this syntax - the specification).
c2b6b97
to
ea69880
Compare
* Mention that only some Node.js versions require experimental-modules flag * Change webpack 2 to just webpack since 3,4 and 5 also support ESM
ea69880
to
bd32390
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.
Thanks!
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
To avoid confusing novices, update Node.js and webpack references.
support ESM without it
website