grist-core
grist-core copied to clipboard
Dependencies: upgrade required nodejs version and supported EcmaScript version
Just a little issue to ask whether what I suggest may be welcome or may encounter objections.
I just felt a bit frustrated to not be able to use some EcmaScript features, like Object.fromEntries
, which is now official since ES2019, because the ecmascript version target for typescript is 2017.
FWIW, some other features are summarized in the kangax table
As latest nodejs LTS is v18 and Debian stable also embeds v18, I would suggest to upgrade:
- the version specified in
.nvmrc
to the latest LTS; - the recommended version in the development guide;
- the target version for typescript
- the version of nodejs in Dockerfile
If you're OK with that, I would be happy to open a new PR for this and see whether the tests continue to pass :)
I believe @georgegevoian has some work in progress related to v18, right George? For the ecmascript version target, what do you think @dsagal, is is finally time to bump it up?
I believe @georgegevoian has some work in progress related to v18, right George? For the ecmascript version target, what do you think @dsagal, is is finally time to bump it up?
That's right. Should be done soon.
For the ecmascript version target, what do you think @dsagal, is is finally time to bump it up?
That being said, I did not consider browsers while thinking of this. Maybe that's reasonable to use a different target for the client code.
I am late to see the huge work made by @georgegevoian two months ago (thank you!)
This issue is nearly solved. There still is the question of the target version for Typescript and of the parser version for Eslint.
NodeJS seems to have a good implementation of EcmaScript 2023, but that's trickier for the browsers, even though theoretically it should be safe assuming browsers are up-to-date.
If you want me to take a look at it, I'll be glad!
tagging @dsagal on the question of whether the time has come to bump the target version for Typescript. We have periodically considered and rejected it for compatibility reasons.
For browsers, upgrading target to es2019
seems safe. I checked throug caniuse statistics, and it's well-supported for the last 3 years of browser versions.
If there is enough reason, we could set a higher version for code built only for server-side, since Node 18 supports es2022
.
I close this issue in favor of #897 (unless I miss some point discussed here that is missing there)