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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big bag o' tweaks #330

Merged
merged 21 commits into from Sep 11, 2019
Merged

Big bag o' tweaks #330

merged 21 commits into from Sep 11, 2019

Conversation

@WickyNilliams
Copy link
Owner

@WickyNilliams WickyNilliams commented Sep 5, 2019

This PR contains a host of tweaks, improvements, fixes, file size savings 馃帀

In terms of file size, we see the following changes:

v0.9.4 (kb) This PR (kb) Savings (%)
Unminified 15.28 10.35 32
Minified 5.76 4.26 26
Min+GZIP 1.7 1.38 19

Pretty good!

self.scroller,
self.update.bind(self)
);
},
Copy link
Owner Author

@WickyNilliams WickyNilliams Sep 5, 2019

I think I'm going to drop this asynchronous behaviour in a future version. I would have done it now, but I wanted to avoid breaking changes. Developers can always defer initialisation themselves if it matters to them.

Copy link
Collaborator

@hacknug hacknug Sep 6, 2019

defer event registration to handle browser potentially restoring previous scroll position

This makes it sound like it never was supposed to be a bulletproof solution so I guess it's okay. Maybe we could add an example to the docs/readme/changelog showing how to deal with it on the new version?

Copy link
Owner Author

@WickyNilliams WickyNilliams Sep 10, 2019

Yeah, it was never perfect. A browser may take longer than 100ms to restore scroll position on a slow connection or long page. An addition to the docs sounds like a good idea 馃憤

@hacknug
Copy link
Collaborator

@hacknug hacknug commented Sep 6, 2019

Completely unnecessary but do you have the numbers for Brotli compression too?

@WickyNilliams WickyNilliams force-pushed the feature/big-bag-o-tweaks branch from ab27fb9 to 6e85771 Sep 10, 2019
@WickyNilliams
Copy link
Owner Author

@WickyNilliams WickyNilliams commented Sep 10, 2019

Good call, I updated the rollup config to output brotli size :) Here's the results pulled from the travis build:

src/Headroom.js 鈫 dist/headroom.min.js...
鈹屸攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹
鈹                                       鈹
鈹   Destination: dist/headroom.min.js   鈹
鈹   Bundle Size:  4.26 KB               鈹
鈹   Gzipped Size:  1.38 KB              鈹
鈹   Brotli size: 1.32 KB                鈹
鈹                                       鈹
鈹斺攢鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹鈹

@WickyNilliams
Copy link
Owner Author

@WickyNilliams WickyNilliams commented Sep 10, 2019

I rebased this branch and dropped the changes to the jQuery/angular plugins, as they were breaking changes. They can be dealt with in a future release

@hacknug
Copy link
Collaborator

@hacknug hacknug commented Sep 10, 2019

@WickyNilliams let me know if there's anything I can help you with!

@WickyNilliams
Copy link
Owner Author

@WickyNilliams WickyNilliams commented Sep 11, 2019

@hacknug sure thing. I don't think there's much can be done for this release, but maybe you'd like to take a stab at removing the async behaviour we discussed above?

@WickyNilliams WickyNilliams merged commit 3dc81ce into master Sep 11, 2019
2 checks passed
@WickyNilliams WickyNilliams deleted the feature/big-bag-o-tweaks branch Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants