-
Notifications
You must be signed in to change notification settings - Fork 274
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
chore: update babel's present-env configuration #1434
Conversation
Turns out this wasn't the problem, and we can leave it unpinned. |
@@ -6,13 +6,13 @@ | |||
"modules": false, | |||
"useBuiltIns": "entry", | |||
"core-js": 3, | |||
"shippedProposals": true, |
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.
Nice, that also gives us a few other things https://github.com/babel/website/blob/0d482dd7ed3451592549009483423f7d37d2fe92/docs/preset-env.md#shippedproposals
} | ||
], | ||
"@babel/preset-react" | ||
], | ||
"plugins": [ | ||
["styled-components", { "displayName": true }], | ||
"@babel/plugin-proposal-class-properties" |
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.
Just wondering if babel was complaining without the shippedProposals: true
?
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.
Honestly didn't check, but just ruled it out of my mind since it was behaving differently between yarn
and npm
at that point after I initially did the yarn upgrade-interactive
.
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.
Went back to the commit and checked; this was not the problem. The problem was we had multiple versions of babel installed, and I believe an older one was still being used by parcel at that time.
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.
what is shippedProposals?
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.
@rperez89 that’s an option of @babel/preset-env
to enable ES features that are shipped in browsers, regardless of their TC39 stage: https://github.com/babel/website/blob/0d482dd7ed3451592549009483423f7d37d2fe92/docs/preset-env.md#shippedproposals
"lint-staged": "^8.1.1", | ||
"parcel-bundler": "^1.10.1", | ||
"parcel-bundler": "^1.12.4", |
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.
It turns out yarn upgrade-interactive
doesn't do a great job of deduping.
Doing a yarn remove
and then yarn add
to re-install these dependencies (the only ones that had babel dependencies) properly dedupes the babel versions and makes the build work.
However, I cannot figure out why the websocket module's require()
is still failing tests. Even going back to jest v25.1.0 and pushing everything else to be the same as master, it still fails now 🤷♂️. Perhaps also a good sign that we should not be creating a websocket connection in our tests :).
Going to let this close for now, we can upgrade this setting at a later time if necessary (since this was only for the dev tools to work well). |
See babel/babel#11451.
While this is not a problem locally because we have a
yarn.lock
, it breaks users who try to install usingnpm
(e.g. users of the CLI).Without this change, we get errors like: