-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Update rollup to version 2.50.5 #8341
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This should prevent Rollup from generating unnecessary code like var invariant__default = /*#__PURE__*/_interopDefaultLegacy(invariant);
It appears our closing of this old @renovate PR to update Rollup to v2 caused @renovate to stop opening PRs to update Rollup to any v2.x.y version, so our version of Rollup has been out of date since then: #6033 Though obviously not ideal, this major version lag hasn't been a problem for us because Rollup v1 still works very well, and we use it only to generate CommonJS bundles, which is a relatively stable build target (CommonJS hasn't changed much lately). We rely on other tools like tsc for critical stuff like TypeScript compilation, and we have numerous ways to verify the output of our build system. With that said, Rollup v2 has some great new features that I'm looking forward to trying, such as `output.inlineDynamicImports`.
Although the upgrade from rollup@1.31.1 to rollup@2.x has been almost entirely seamless (yay!), rollup@2.26.8 included a change (rollup/rollup#3753) that made it possible for the options.external function to receive fully resolved, absolute ID strings, so our implementation of that function needed to be updated to accommodate that possibility.
This affects only `react`, `prop-types`, and `hoist-non-react-statics` packages, which all export an object that can be considered a module namespace object, so this transform is not needed: function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { n[k] = e[k]; }); } n['default'] = e; return Object.freeze(n); } var React__namespace = /*#__PURE__*/_interopNamespace(React);
benjamn
force-pushed
the
update-rollup-to-v2
branch
from
June 1, 2021 19:34
044520c
to
1bb182c
Compare
hwillson
approved these changes
Jun 2, 2021
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 for catching and fixing this @benjamn! (and sorry for inadvertently causing renovate to skip all of 2.x 😳)
dylanwulf
reviewed
Jun 23, 2021
benjamn
added a commit
that referenced
this pull request
Jun 25, 2021
Addressing concerns raised by @dylanwulf on the PR that introduced this code: #8341 (review)
1 task
2 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It appears our closing of this old @renovate PR to update Rollup to v2 caused @renovate to stop opening PRs to update Rollup to any v2.x.y version, so our version of Rollup has been out of date since then.
Though obviously not ideal, this major version lag hasn't been a problem for us because Rollup v1 still works very well, and we use it only to generate CommonJS bundles, which is a relatively stable build target (CommonJS hasn't changed much lately). We rely on other tools like
tsc
for critical stuff like TypeScript compilation, and we have numerous ways to verify the output of our build system. With that said, Rollup v2 has some great new features that I'm looking forward to trying, such asoutput.inlineDynamicImports
!To verify these changes, I compared the output of the build system before and after this upgrade (taking f76ec87 and 2ae6ddd as given/prior):
All of these changes seem harmless/fine/good to me!