neovim / node-client

Nvim Node.js client and plugin host
https://neovim.io/node-client/
MIT License
463 stars 49 forks source link

deps: remove babel #241

Open justinmk opened 9 months ago

justinmk commented 9 months ago

Problem

Babel adds complication to the build/dependencies. We aren't using it for anything important, looks like it is used to add decorators support.

Solution

Notes

$ npm ci
npm WARN deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained
. Please use @babel/plugin-transform-class-properties instead.
justinmk commented 5 months ago

@billyvg @rhysd can you help me understand the use of babel in this project? It looks like babel is only used here: https://github.com/neovim/node-client/blob/56fefb9195cfe4e3e7a5c9a5d073eb18c4074992/packages/example-plugin-decorators/package.json#L8

babel is targeting node 8: https://github.com/neovim/node-client/blob/56fefb9195cfe4e3e7a5c9a5d073eb18c4074992/.babelrc.js#L3 so I had expected it to translate packages/neovim/ to node8-compatible syntax, but seems like that isn't happening.

So if we want the "neovim" package to be compatible with an old target such as es2015, we currently can't rely on babel to polyfill es2022 libraries/features--rather we must avoid using es2022 libraries in our typescript code.

Is this a correct understanding?