Closed retyui closed 1 year ago
Does Hermes support all of these features?
I don't have any ideas what Hermes support (
If I understand this setting correctly, I don't think we should recommend ES2019 when Hermes is our lowest common denominator. It doesn't mean that you can't have ES2019 in your own codebase though. You're free to bump it if you don't use Hermes or use your own polyfills.
Let's try look at it from developer perspective
He/She creates a new React Native project then add typescript support, and tried to use one of modern methods:
Object.fromEntries(...)
// ^^^^^^^^^^ TS2550: Property 'fromEntries' does not exist on type 'ObjectConstructor'.
// Do you need to change your target library?
// Try changing the 'lib' compiler option to 'es2019' or later.
And as result the Typescript thrown and error, with suggestion Try changing the 'lib' compiler option to 'es2019' or later
Developer is smart and decided to check it in runtime, run it on iOS everything OK, run it on Android everything OK. No runtime exceptions!!!
What conclusions can he/she draw?
Then make a release and started getting bad review that app is crashing (for iOS 11.0...12.3
users)
From my point of view this a big gab, why documentation doesn't explained why es2017
is default lib
option
Agree, that's not required to update lib
to 2019
but we definitely need to clarify it
Yes, we should clarify this in the documentation.
Does Hermes support all of these features?
@tido64 Now I can answer this question, All es2019
lib features supported by the 3 latest Hermes versions
See more: https://retyui.github.io/react-native-compat-table/
This is really awesome! How did you generate this table? I guess we should recommend 2019 then?
Or maybe we should be more granular, e.g. ["ES2017.object", "ES2017.String", ...]
. I know Intl support isn't complete, so the table is a bit misleading there.
In TypeScript 4.5, lib files can be overriden by npm modules, find out more in the blog.
also, we can define custom lib
{
"dependencies": {
"@typescript/lib-2017": "npm:@types/hermes-0-11-0"
}
}
but it is required modern version of TS
👋 Hey there, it looks like there has been no activity on this issue in the last 90 days. Has the issue been fixed, or does it still require the community attention? This issue will be closed in the next 7 days if no further activity occurs. Thank you for your contributions.
Description
Can we recommend a
"lib": ["es2019"]
forreact-native@0.69.x
and above intsconfig.json
?What is the problem?
We still recommend to use
es2017
for ts config, but with a new minimal iOS version requirements (12.4
)Links
11
=>12.4
commit: https://github.com/facebook/react-native/commit/982ca30de079d7e80bd0b50365d58b9048fb628fHow can we address it?
Why is it important?
Users will be sure that it's safety to use modern JavaScript features and it won't cause crash in runtime
Who needs this?
TypeScript users
When should this happen (use version numbers if needed)?
React Native 0.69.0