Skip to content

React Native 69 will use iOS 12.4 as minimal version but we still recommends es2017 in TS config #275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
retyui opened this issue Jun 22, 2022 · 3 comments · Fixed by #276

Comments

@retyui
Copy link
Contributor

retyui commented Jun 22, 2022

We still recommend to use lib: es2017 in ts config, but a new minimal iOS version for [email protected] is 12.4

// iOS 11
Intl.PluralRules // undefined (es2018.intl)
Symbol.asyncIterator // undefined (es2018.asynciterable)
String.prototype.trimStart // undefined (es2019.string)
String.prototype.trimEnd // undefined (es2019.string)
Object.fromEntries // undefined (es2019.object)
Array.prototype.flat // undefined (es2019.array)
Array.prototype.flatMap // undefined (es2019.array)

// iOS 12.4
Intl.PluralRules // function
Symbol.asyncIterator // Symbol(Symbol.asyncIterator)
String.prototype.trimStart // function
String.prototype.trimEnd // function
Object.fromEntries // function
Array.prototype.flat // function
Array.prototype.flatMap // function

So, can we update es2017 => es2019 as all es2019 features implemented in Hermes, iOS 12.4 and jsc-android ? (see "Compare table")

Links

@radko93
Copy link
Collaborator

radko93 commented Jun 22, 2022

We can upgrade, but I'm not sure if it matters so much as it's babel and https://github.com/facebook/metro/tree/main/packages/metro-react-native-babel-preset that transpiles the code before it actually runs on the device. But I might be wrong.

@retyui
Copy link
Contributor Author

retyui commented Jun 22, 2022

@radko93 Babel can make impact for new syntax that can't be Polyfilled for example:

const value = 100_000_000; // numeric separators
async function asynFn(){ await my(); } // async/await
function* generator(){ yield i; } // Generator Function 

but in case of new methods, what Babel can matters here:

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.

@radko93
Copy link
Collaborator

radko93 commented Jun 22, 2022

Then probably we can change it once we update for 0.69.

radko93 added a commit that referenced this issue Jun 23, 2022
radko93 added a commit that referenced this issue Jun 23, 2022
* feat: update to 0.69.0

closes #275

* chore: update README
leotm added a commit to leotm/react-native-template-new-architecture that referenced this issue Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants