Panoptes-Front-End icon indicating copy to clipboard operation
Panoptes-Front-End copied to clipboard

build(deps): remove babel-plugin-transform-es2015-modules-commonjs

Open eatyourgreens opened this issue 8 months ago • 1 comments

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 not supported in Babel 7.)

  • use Babel to transpile .coffee and .cjsx files from CJS to ESM.
  • explicitly set the Babel source type to ESM, which has been the default for a while now. All of PFE’s JS and JSX files use ESM.
  • fix broken module.exports in a couple of places.
  • fix broken propTypes in Pages Editor components.
  • npm audit fix.
  • fixes #7115.
  • fixes #7116.
  • fixes some missing React keys in the app router.

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 on http://localhost:3735 or http://local.zooniverse.org:3735. This method reproduces a production deploy, but without the nginx reverse proxy.

npm audit and npm ci should show 0 problems, with the changes here.

Screenshot of the install log, from a build, showing 0 vulnerabilities.

Required Manual Testing

  • [ ] Does the non-logged in home page render correctly?
  • [ ] Does the logged in home page render correctly?
  • [ ] Does the projects page render correctly?
  • [ ] Can you load project home pages?
  • [ ] Can you load the classification page?
  • [ ] Can you submit a classification?
  • [ ] Does talk load correctly?
  • [ ] Can you post a talk comment?

Review Checklist

  • [ ] Does it work in all major browsers: Firefox, Chrome, Edge, Safari?
  • [ ] Does it work on mobile?
  • [ ] Can you npm ci and app works as expected?
  • [ ] If the component is in coffeescript, is it converted to ES6? Is it free of eslint errors? Is the conversion its own commit?
  • [ ] Are the tests passing locally and on GitHub Actions?

Optional

eatyourgreens avatar May 31 '24 10:05 eatyourgreens