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

Change TypeScript target to es2019 #21

Closed
mpsq opened this issue May 9, 2023 · 4 comments
Closed

Change TypeScript target to es2019 #21

mpsq opened this issue May 9, 2023 · 4 comments

Comments

@mpsq
Copy link

mpsq commented May 9, 2023

This library is currently targeting es2020 (see tsconfig.json). This results is narrower compatibility, for example this library is affected by cypress-io/cypress#20753 (because of es2019 does not support optional chaining. Changing the target to es2019 would increase compatibility without affecting too much the output.
What do you think?

@perry-mitchell
Copy link
Owner

Yes I'd happily accept such a change. Would you be willing to make a PR?

@mpsq
Copy link
Author

mpsq commented May 10, 2023

Of course, see #22

@kibertoad
Copy link

@mpsq But why? All modern browsers and supported Node versions are compatible with ES2020.
targetting older ES is likely to have perf impact.

@perry-mitchell
Copy link
Owner

Ok, after checking this it seems like TS doesn't like the 2019 module type:

image

image

And having thought about it for a bit, I do concur with @kibertoad that 2020 should be plenty in terms of browser support. If required it could be compiled, again, to an older format if needed in niche environments (ie. not the concern of this project).

Apologies for wasting time here.. let's leave it as is for now.

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

No branches or pull requests

3 participants