Skip to content
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

TypeScript target: post-ie11 world #12593

Open
mfulton26 opened this issue Jul 16, 2022 · 0 comments
Open

TypeScript target: post-ie11 world #12593

mfulton26 opened this issue Jul 16, 2022 · 0 comments

Comments

@mfulton26
Copy link

Is your proposal related to a problem?

I don't want my offline-first React app to be bloated in size nor for default React apps to unnecessarily target outdated ECMAScript.

With Internet Explorer 11 support ended what does this mean for what version of ES we can target for web applications created through create-react-app?

I am looking forward to being able to use things life async generators without high transpilations costs once we can safely target versions of ECMAScript with these features fully supported natively.

Describe the solution you'd like

  1. Change the generated default tsconfig.json target to something greater than ES5 now that IE11 does not need to be supported. This should update relevant templates (typescript, pwa-typescript, etc.).
  2. Update docs to explain that this can be lowered to ES5 by the developer if they want to use react-app-polyfill to support Internet Explorer.
  3. Update docs to explain that this can be set to a higher value depending on your browserslist (https://create-react-app.dev/docs/supported-browsers-features/); in fact, it would be slick if there were a way to suggest a TypeScript target given a browserlist.

Describe alternatives you've considered

  • leave things as they are which likely means developers will continue to target ES5 even though such may be unnecessary
  • add additional documentation for TypeScript users as to how to smartly navigate this (e.g. if I'm building an offline-first React app where I know all of my users are using iOS Safari or Android Chrome and I know the minimum versions I need to support then how do I map this back to an appropriate TypeScript target?)

Additional context

I'm looking forward to TypeScript being more strictly typing for my JavaScript and less about compiling down do older JavaScript. Thank you for this great tool for building web apps and helping me understand what is meaningful to change and not change here in a post-ie11 world.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant