grist-core icon indicating copy to clipboard operation
grist-core copied to clipboard

Dependencies: upgrade required nodejs version and supported EcmaScript version

Open fflorent opened this issue 1 year ago • 6 comments

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:

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 :)

fflorent avatar Aug 09 '23 15:08 fflorent

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?

paulfitz avatar Aug 09 '23 18:08 paulfitz

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.

georgegevoian avatar Aug 09 '23 18:08 georgegevoian

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.

fflorent avatar Aug 10 '23 08:08 fflorent

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!

fflorent avatar Dec 12 '23 18:12 fflorent

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.

paulfitz avatar Dec 12 '23 19:12 paulfitz

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.

dsagal avatar Dec 12 '23 20:12 dsagal

I close this issue in favor of #897 (unless I miss some point discussed here that is missing there)

fflorent avatar Mar 14 '24 16:03 fflorent