-
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
Reenable Rollup preserveModules option, and consolidate utils/utilities directories. #5437
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
With `preserveModules` off, rollup bundles the ESM code up and stores it in `dist/index.js`, when our first configured rollup job runs. This job is intended to run the `invariantPlugin` against all ESM code, updating `InvariantError`'s in place. It shouldn't be storing the results of running the `invariantPlugin` in `dist/index.js`. Enabling `preserveModules` ensures that changes are written back into originating files.
Importing from module index files causes an issue with rollup when using `preserveModules`, such that rollup expands index imports in files to include extra imports that aren't needed. Since we don't really need index files, let's just get rid of them.
It's only used by tests.
Let's get these back to being internal utilities (to help reduce our public API).
benjamn
approved these changes
Oct 11, 2019
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 looks great to me! I have some commits on my branch that I'd like to cherry-pick on top of this, to avoid merge conflicts later, so I can either push more commits to the PR, or we can go ahead and merge it into release-3.0
.
benjamn
changed the title
More bundling adjustments
Reenable Rollup preserveModules option, and consolidate utils/utilities directories.
Oct 11, 2019
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.
This PR does the following:
preserveModules
feature, to make sure ESM files are modified in place (instead of being bundled) when running theinvariantPlugin
.index.ts
files, to stop confusing rollup when using thepreserveModules
feature./utils/
,/utilities
, and/utilities/utils
into a more logical utility directory structure.index.ts
that we no longer want to be available externally.