You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: