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

chore(parser): Hoist API_PATH constants in endpoint nodes #852

Merged
merged 1 commit into from
Dec 21, 2024

Conversation

absidue
Copy link
Collaborator

@absidue absidue commented Dec 20, 2024

Hoisting these constants into normal variables results in a shaved 1053 bytes off FreeTube's bundle size, as it didn't require the private property polyfill and was able to inline the constants, as they are only used once. I didn't inline them in the source code to allow server side apps that likely handle a lot more requests and don't use bundling benefit from only needing to initialise those strings once.

@LuanRT LuanRT merged commit 5050f48 into LuanRT:main Dec 21, 2024
4 checks passed
@absidue absidue deleted the api-path-hoisting branch December 21, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants