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

chore: update babel's present-env configuration #1434

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .babelrc
Expand Up @@ -6,13 +6,13 @@
"modules": false,
"useBuiltIns": "entry",
"corejs": 3,
"shippedProposals": true,
Copy link
Contributor

Choose a reason for hiding this comment

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

}
],
"@babel/preset-react"
],
"plugins": [
["styled-components", { "displayName": true }],
"@babel/plugin-proposal-class-properties"
Copy link
Contributor

@bpierre bpierre Jun 3, 2020

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

what is shippedProposals?

Copy link
Contributor

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

],
"env": {
"test": {
Expand Down
13 changes: 6 additions & 7 deletions package.json
Expand Up @@ -67,12 +67,11 @@
},
"devDependencies": {
"@aragon/os": "^4.0.0",
"@babel/core": "^7.6.4",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/preset-env": "^7.6.3",
"@babel/preset-react": "^7.6.3",
"@babel/core": "^7.10.4",
"@babel/preset-env": "^7.10.4",
"@babel/preset-react": "^7.10.4",
"babel-eslint": "^10.0.1",
"babel-jest": "^25.1.0",
"babel-jest": "^26.0.1",
"babel-plugin-styled-components": "^1.10.6",
"bundlewatch": "^0.2.6",
"cross-env": "^5.2.0",
Expand All @@ -89,9 +88,9 @@
"eslint-plugin-react-hooks": "^1.6.0",
"eslint-plugin-standard": "^4.0.0",
"husky": "^1.0.1",
"jest": "^25.1.0",
"jest": "^26.0.1",
"lint-staged": "^8.1.1",
"parcel-bundler": "^1.10.1",
"parcel-bundler": "^1.12.4",
Copy link
Contributor Author

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 :).

"parcel-plugin-bundle-visualiser": "^1.2.0",
"prettier": "^1.19.1",
"ps-node": "^0.1.6",
Expand Down