Skip to content

more modern output, reducing size #2286

@SimonSiefke

Description

@SimonSiefke

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions