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

Update TypeScript compilation target #10

Merged
merged 2 commits into from
Nov 28, 2022

Conversation

gimenete
Copy link
Contributor

I'm not 100% sure that ES2020 is the best target, but I think the target should be updated because currently the generated JS is too verbose. It even assumes that async/await are not supported by the runtime.

Specially since this library is meant to be used only in cloudflare workers:

  • most modern JS features should be supported.
  • the size of the generated JS matters.

Here's a list of files with the before/after size:

dist/cjs/exceptions.js  1.8K -> 653B
dist/cjs/index.js       816B -> 816B
dist/cjs/openapi.js     5.9K -> 4.1K
dist/cjs/parameters.js   17K ->  13K
dist/cjs/route.js       8.7K -> 3.6K
dist/cjs/types.js        77B ->  77B
dist/cjs/ui.js          1.7K -> 1.6K
dist/esm/exceptions.js  1.6K -> 364B
dist/esm/index.js       137B -> 137B
dist/esm/openapi.js     5.7K -> 3.9K
dist/esm/parameters.js   16K ->  12K
dist/esm/route.js       8.5K -> 3.4K
dist/esm/types.js        11B ->  11B
dist/esm/ui.js          1.6K -> 1.5K

@G4brym G4brym merged commit 55353e5 into cloudflare:main Nov 28, 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 this pull request may close these issues.

2 participants