Skip to content
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

Merged
merged 1 commit into from Jan 26, 2021

Conversation

ludofischer
Copy link
Contributor

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

To avoid confusing novices, update Node.js and webpack references.

  • Remove mention of experimental flag in Node.js since last two LTS versions
    support ESM without it
  • Change webpack 2 to just webpack since 3,4 and 5 also support ESM and webpack 2 docs are not on the webpack
    website

@ludofischer ludofischer changed the title Modernize references to other software. Modernize references to Node.js and webpack Jan 25, 2021
@codecov
Copy link

codecov bot commented Jan 25, 2021

Codecov Report

Merging #3937 (bd32390) into master (889fa52) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 889fa52...bd32390. Read the comment docs.

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...
Copy link
Contributor

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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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.

Copy link
Contributor Author

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).

* 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
Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lukastaegert lukastaegert merged commit 13489b9 into rollup:master Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants