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

Updated to @babel/core@7, node 10.14.2 #393

Merged
merged 4 commits into from
Dec 16, 2018
Merged

Conversation

mcollina
Copy link
Member

Fixes: #392

@mcollina
Copy link
Member Author

@vweevers can you please review?

@vweevers
Copy link
Contributor

Could you split the commits into manual changes and generated code?

"@babel/plugin-transform-spread": "^7.2.0",
"@babel/plugin-transform-template-literals": "^7.2.0",
"@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.2.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

This babel setup is fragile. For example, @babel/preset-env is a dependency, but not used in the configuration. And @babel/plugin-transform-classes is used, but not listed in dependencies. I'm guessing the setup works because @babel/plugin-transform-classes is a dependency of @babel/preset-env and hoisted by npm.

IMO we have to make a choice: either we use the preset, or we don't and install+configure all plugins ourselves.

Copy link
Contributor

Choose a reason for hiding this comment

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

Correction: @babel/preset-env is used, not by the main build script, but by the update-browser-errors npm script. Still, we're missing dependencies.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you recommend some different way to do this? This is definitely my best, I feel using babel lead to fragile code anyway.

I've added the missing dependencies.

Copy link
Contributor

Choose a reason for hiding this comment

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

Luckily, all the plugins that we use, are included in @babel/preset-env. So we can definitely simplify the setup. With some configuration to specify target environments (node and browser versions), which could reduce the number of code transformations. If we put that configuration in a .babelrc, it will be applied to both the build script and update-browser-errors.

We could even have two builds, one for node (with less code transformations, possibly better performance?) and one for browsers.

I can open an issue or PR (but might not get around to it until ~ a week from now).

Copy link
Member Author

Choose a reason for hiding this comment

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

Would you be ok if we land this, ship it in a release, and then you send a PR to clean things up?

package.json Show resolved Hide resolved
@mcollina
Copy link
Member Author

PTAL CI is green 🎉.

"bl": "^2.0.0",
"buffer": "^5.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was buffer needed before?

Copy link
Member Author

Choose a reason for hiding this comment

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

No idea, likely a leftover.

Copy link
Contributor

@vweevers vweevers left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants