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

more modern output, reducing size #2286

Closed
SimonSiefke opened this issue Jul 29, 2023 · 0 comments
Closed

more modern output, reducing size #2286

SimonSiefke opened this issue Jul 29, 2023 · 0 comments

Comments

@SimonSiefke
Copy link

What problem are you trying to solve?

When looking at the code of got inside node_modules, some parts look like this:

Object.defineProperty(this, "options", {
	enumerable: true,
	configurable: true,
	writable: true,
	value: void 0,
});
Object.defineProperty(this, "response", {
	enumerable: true,
	configurable: true,
	writable: true,
	value: void 0,
});
Object.defineProperty(this, "requestUrl", {
	enumerable: true,
	configurable: true,
	writable: true,
	value: void 0,
});
// lots of similar code

Using a more modern typescript output target like ES2022 would completely remove this kind code, while still being compatible with node 14, 16, 18 and 20.

Size improvements

This would reduce the total javascript size from 217.1 kB to 213 kB (2% improvement).

sindresorhus added a commit that referenced this issue Jul 30, 2023
Closes #2287
Closes #2286
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 a pull request may close this issue.

1 participant