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

Update Rollup plugins #13265

Merged
merged 1 commit into from May 6, 2021

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented May 5, 2021

Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

@@ -351,6 +351,10 @@ function buildRollup(packages, targetBrowsers) {
"regenerate-unicode-properties"
) + "/**/*.js",
],
// Never delegate to the native require()
ignoreDynamicRequires: true,
Copy link
Member Author

Choose a reason for hiding this comment

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

This would have caught #12839 earlier

// Never delegate to the native require()
ignoreDynamicRequires: true,
// Align with the Node.js behavior
defaultIsModuleExports: true,
Copy link
Member Author

Choose a reason for hiding this comment

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

This makes it possible to remove a custom plugin from our Babel config, by moving the logic to Rollup itself.

@@ -2,7 +2,7 @@ import syntaxObjectRestSpread from "@babel/plugin-syntax-object-rest-spread";

export default function ({ types: t }) {
return {
inherits: syntaxObjectRestSpread,
inherits: syntaxObjectRestSpread.default,
Copy link
Member Author

Choose a reason for hiding this comment

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

These syntax plugins are from packages outside of the monorepo which are and will always be CommonJS. With this PR we fully match the Node.js behavior, so we need to add .default in order to get module.exports.

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 5, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 939e04f:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@babel-bot
Copy link
Collaborator

babel-bot commented May 5, 2021

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/45850/

@nicolo-ribaudo nicolo-ribaudo added this to In progress in Move to native ES modules via automation May 5, 2021
Copy link
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

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

💯

@nicolo-ribaudo nicolo-ribaudo merged commit 9440318 into babel:main May 6, 2021
Move to native ES modules automation moved this from In progress to Done May 6, 2021
@nicolo-ribaudo nicolo-ribaudo deleted the update-rollup-plugins branch May 6, 2021 06:53
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Aug 6, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Dependency ⬆️
Development

Successfully merging this pull request may close these issues.

None yet

4 participants