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

Update all Babel package versions. #1344

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

lindapaiste
Copy link
Contributor

  • Replace all babel- v6 packages with v7 @babel/ packages.
  • Update babel-loader from v7 to v8.
  • Change package name from "babel-polyfill" to "@babel/polyfill" in webpack config and karma config.
  • Change module.exports = in src/index.js to export default, as module.exports cannot be used in files with import syntax.
  • Add libraryExport: "default" to the webpack config, which is needed due to the previous change.

@@ -16,6 +16,7 @@ export default {
output: {
path: resolve(__dirname, "dist"),
publicPath: "/",
libraryExport: "default",
Copy link
Contributor

Choose a reason for hiding this comment

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

positive affirmation:

  • Gosh, i struggled SO long trying to figure out how to get the default export to work. Webpack can be so insane that tracking down these options is a challenge. Thanks for this!

@@ -24,7 +24,7 @@ module.exports = config => {
// use different import syntaxes so it's not easy to just require it here.
// Maybe this could be put into a JSON file, but the include in the module
// rules is dynamic.
entry: ["babel-polyfill", "./src/index.js"],
entry: ["@babel/polyfill", "./src/index.js"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Question:

I don't want to send us on a wild goose chase so if this is working, then Im totes happy to keep it! I got lost in trying to fix this and it seemed like a lot of heartache for not a big difference in code change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. Definitely seems like that should work!

@joeyklee
Copy link
Contributor

joeyklee commented Apr 12, 2022

🤔 hiii I'm trying to run this locally and seeing the following:

➜  ml5-library git:(lindapaiste-fix/babel-versions) ✗ npm i
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules/eslint-nibble/eslint-stats@github:ianvs/eslint-stats#cb1ff8251b50c7f0cb431a2b395431ebfdeb10c8" as it does not contain a package.json file.

I deleted my node_modules and tried to reinstall but no dice.

Update: whoops! looked like I had some zombie files! It's totally working!

Copy link
Contributor

@joeyklee joeyklee left a comment

Choose a reason for hiding this comment

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

LGTM! I've tested this locally and can confirm that this is working as expected.

Thanks so much for teaching me something new and for doing this critical infrastructure support work. It really helps move us towards modernizing our dev setup and tooling! 🥇

@joeyklee joeyklee merged commit 4d9b626 into ml5js:main Apr 13, 2022
@lindapaiste lindapaiste deleted the fix/babel-versions branch May 8, 2022 20:15
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