sudara / alonetone

A free, open source, non-commercial home for musicians and their music
https://alonetone.com
MIT License
346 stars 89 forks source link

Support older browsers #1163

Closed sudara closed 2 years ago

sudara commented 2 years ago

Post 7.0 upgrade, the browserslist is identical except for the not IE 11 added in the Rails 7 upgrade bump to babel.

I made this change because of a series of warnings:

Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-property-in-object since the "loose" mode option was set to "true" for @babel/plugin-proposal-class-properties.
The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
    ["@babel/plugin-proposal-private-property-in-object", { "loose": true }]
to the "plugins" section of your Babel config.

I don't understand Babel intimately but "loose" appears to mean that it doesn't have to just stick to ES6, it can also use ES5: https://2ality.com/2015/12/babel6-loose-mode.html

However, FF 52 was supported before this change and is now unsupported

➜  alonetone git:(javascript_tuning) npx browserslist
and_chr 96
and_ff 95
and_qq 10.4
and_uc 12.12
android 96
baidu 7.12
chrome 96
chrome 95
chrome 94
edge 96
edge 95
firefox 95
firefox 94
firefox 91
firefox 78
ios_saf 15.2
ios_saf 15.0-15.1
ios_saf 14.5-14.8
ios_saf 14.0-14.4
ios_saf 12.2-12.5
kaios 2.5
op_mini all
op_mob 64
opera 82
opera 81
opera 80
safari 15.2
safari 15.1
safari 15
safari 14.1
safari 13.1
samsung 15.0
samsung 14.0

Related: https://github.com/rails/webpacker/issues/3008

sudara commented 2 years ago

ERROR in ./app/javascript/application.js
Module build failed (from ./node_modules/@rails/webpacker/node_modules/babel-loader/lib/index.js):
Error: [BABEL]: Cannot find module 'chalk'
Require stack:
- /data/alonetone/node_modules/@babel/plugin-proposal-object-rest-spread/node_modules/@babel/highlight/lib/index.js
- /data/alonetone/node_modules/@babel/plugin-proposal-object-rest-spread/node_modules/@babel/code-frame/lib/index.js
- /data/alonetone/node_modules/@babel/plugin-proposal-object-rest-spread/node_modules/@babel/template/lib/parse.js
- /data/alonetone/node_modules/@babel/plugin-proposal-object-rest-spread/node_modules/@babel/template/lib/string.js
- /data/alonetone/node_modules/@babel/plugin-proposal-object-rest-spread/node_modules/@babel/template/lib/builder.js
- /data/alonetone/node_modules/@babel/plugin-proposal-object-rest-spread/node_modules/@babel/template/lib/index.js
- /data/alonetone/node_modules/@babel/plugin-proposal-object-rest-spread/node_modules/@babel/core/lib/index.js
- /data/alonetone/node_modules/@babel/plugin-proposal-object-rest-spread/lib/index.js
- /data/alonetone/node_modules/@rails/webpacker/node_modules/@babel/core/lib/config/files/module-types.js
- /data/alonetone/node_modules/@rails/webpacker/node_modules/@babel/core/lib/config/files/configuration.js
- /data/alonetone/node_modules/@rails/webpacker/node_modules/@babel/core/lib/config/files/index.js
- /data/alonetone/node_modules/@rails/webpacker/node_modules/@babel/core/lib/index.js
- /data/alonetone/node_modules/@rails/webpacker/node_modules/babel-loader/lib/index.js
- /data/alonetone/node_modules/loader-runner/lib/loadLoader.js
- /data/alonetone/node_modules/loader-runner/lib/LoaderRunner.js
- /data/alonetone/node_modules/webpack/lib/NormalModule.js
- /data/alonetone/node_modules/webpack/lib/index.js
- /data/alonetone/node_modules/webpack-cli/lib/webpack-cli.js
- /data/alonetone/node_modules/webpack-cli/lib/bootstrap.js
- /data/alonetone/node_modules/webpack-cli/bin/cli.js
- /data/alonetone/node_modules/webpack/bin/webpack.js (While processing: /data/alonetone/node_modules/@babel/plugin-proposal-object-rest-spread/lib/index.js)
- ```