-
Notifications
You must be signed in to change notification settings - Fork 434
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
Refactor head_snapshot #832
base: main
Are you sure you want to change the base?
Conversation
Sean's recommendations bring the minimized package size down further to 71.79k or 1.36% smaller. |
@seanpdoyle Tried once more to implement the grouping by class, but couldn't get typescript to accept my various attempts to generic-tize the elements array. Would you be able to take a stab at it? Or can we consider merging this branch to realize the size & speed benefits for now, and attempt to make further optimizations later. |
Bump for attention. |
Typescript removed. Ready to go and a great candidate for Turbo 8. Looking for review and approval. |
Not planning on helping here too much, but I think your test is still in TS |
Tests updated. Ready for review. |
Verified: works great in Turbo 8. |
This modifies head_snapshot to sort elements by type as the snapshot is created resulting in less code, a more compact minimized codebase, and increased performance.
The current head snapshot comparison method compares all items in the header against themselves. This branch compares scripts to scripts, styles to styles, meta to meta, and so on. This allows for more efficient processing of items during merge. The primary benefit to this refactor is how it affects the size of the Turbo library - reducing the size of the minified code base by 1.3% (72.78k -> 71.84k).