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

Switch to a more modern TypeScript target #231

Open
marcodejongh opened this issue Mar 3, 2023 · 1 comment
Open

Switch to a more modern TypeScript target #231

marcodejongh opened this issue Mar 3, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@marcodejongh
Copy link

Enhancement description

Currently target in tsconfig is set to "es5", as a result TypeScript outputs ES5 which includes generators for any async code. Generators are hell for debugging node. Also, ES5 at this point is only required for IE11 support and ancient ancient versions of node.js. For example node 8 already supports es2017: https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping#node-8.

Also by making this change the bundle size of the module should go down for users that bundle this module into the browser

The problem it solves

Better debugging + lower bundle size

Additional information

It probably wouldn't be a bad idea to also leave import/export statements in the code by setting "module" setting to ES2020. ES2020 is required to allow for dynamic imports, but once that is done 2 dists will have to be build one for browser & 1 for node consumers

@marcodejongh marcodejongh added the enhancement New feature or request label Mar 3, 2023
@henningmu
Copy link
Contributor

That makes a lot of sense, @marcodejongh. Would you be willing to create the PR with the proposed changes? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants