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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 commented Sep 6, 2019

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

@WickyNilliams
Copy link
Owner Author

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

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 commented Sep 10, 2019

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

@WickyNilliams
Copy link
Owner Author

@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
@WickyNilliams WickyNilliams deleted the feature/big-bag-o-tweaks branch September 11, 2019 11:03
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 this pull request may close these issues.

2 participants