-
Notifications
You must be signed in to change notification settings - Fork 75
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
build(deps): remove babel-plugin-transform-es2015-modules-commonjs #7114
base: master
Are you sure you want to change the base?
build(deps): remove babel-plugin-transform-es2015-modules-commonjs #7114
Conversation
48f2cba
to
1f23f09
Compare
@@ -125,7 +124,7 @@ | |||
"start": "export NODE_ENV=development; check-engines && check-dependencies && webpack-dashboard -p 3736 -- webpack-dev-server --config ./webpack.dev.js", | |||
"_build": "export HEAD_COMMIT=$(git rev-parse --short HEAD); check-engines && check-dependencies && rimraf dist; webpack --config ./webpack.build.js --progress --color", | |||
"build-production": "export NODE_ENV=production; npm run _build", | |||
"serve-static": "export NODE_ENV=staging; check-engines && check-dependencies && npm run _build && node ./static-server.js", | |||
"serve-static": "npm ci; export NODE_ENV=production; check-engines && check-dependencies && npm run _build && node ./static-server.js", |
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.
Noting here that staging
is an invalid value for NODE_ENV
in modern Webpack builds. See https://webpack.js.org/configuration/mode/.
@@ -1,6 +1,7 @@ | |||
module.exports = function (api) { | |||
api.cache(true); | |||
return { | |||
sourceType: 'module', |
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.
See https://babeljs.io/docs/options#sourcetype. ESM is the default for Babel 7.
b30e4d8
to
af569f2
Compare
<Route path=':locale'> | ||
{SLUGS.map(slug => <MonorepoRoute path={slug} />)} | ||
{SLUGS.map(slug => <MonorepoRoute key={slug} path={slug} />)} |
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.
Not really related to the other changes here, but the missing key warnings made real React errors harder to spot while I was chasing down a couple of bugs in this PR. So this makes the console a little bit less noisy.
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.
#7116 also got in the way of debugging React errors on this branch, so I might fix that here too.
69e5fef
to
7d711bd
Compare
7d711bd
to
6df9cd8
Compare
6e99494
to
354fd0f
Compare
354fd0f
to
7691256
Compare
Remove `babel-plugin-transform-es2015-modules-commonjs`, which is 6 years out-of-date and no longer supported. It generates security warnings in the console, because of outdated dependencies on `babel-traverse` (also 6 years out-of-date and unsupported.) - transpile `.coffee` and `.cjsx` files from CJS to ESM with Babel. - fix broken `module.exports` in a couple of places. - `npm audit fix`.
7691256
to
d78d8cf
Compare
Remove
babel-plugin-transform-es2015-modules-commonjs
, which is 6 years out-of-date and no longer supported. It generates security warnings in the console, because of outdated dependencies onbabel-traverse
(also 6 years out-of-date and not supported in Babel 7.).coffee
and.cjsx
files from CJS to ESM.module.exports
in a couple of places.propTypes
in Pages Editor components.npm audit fix
.You can test this locally a couple of ways:
npm start
: development React build with hot module reloading and React debugging errors in the console.npm run serve-static
: build the production bundle with Webpack, and serve it onhttp://localhost:3735
orhttp://local.zooniverse.org:3735
. This method reproduces a production deploy, but without the nginx reverse proxy.npm audit
andnpm ci
should show 0 problems, with the changes here.Required Manual Testing
Review Checklist
npm ci
and app works as expected?Optional
ChangeListener
orPromiseRenderer
components with code that updates component state?