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

Huge savings switching to modular Firebase builds #48

Merged
merged 3 commits into from Nov 13, 2016

Conversation

@addyosmani
Copy link
Contributor

@addyosmani addyosmani commented Nov 13, 2016

Over in ReactHN, we saw decent savings switching from including the entire Firebase SDK to just using the parts we needed (database and app). This PR switches Vue HN over to using just those pieces and bumps you to a more recent version of Firebase too.

Build before:
screen shot 2016-11-13 at 10 08 35 am

Build after:
screen shot 2016-11-13 at 10 09 17 am

A lot of this is down to no longer needing to include Firebase features like auth, storage and messaging.

Gzipped, this would put the total build.js at under 100KB (closer to 90):
screen shot 2016-11-13 at 10 12 43 am

It was previously 147KB gzipped before this change.

On Lighthouse, this makes Vue interactive in <1700ms on desktop:
screen shot 2016-11-13 at 10 18 16 am

and around the 4s mark on a Nexus 5X with initial testing.

Views all appear to work as intended:

screen shot 2016-11-13 at 10 27 28 am
screen shot 2016-11-13 at 10 27 35 am

@yyx990803
Copy link
Member

@yyx990803 yyx990803 commented Nov 13, 2016

Thanks for the PR! Actually, it's probably more relevant to submit the same PR to the 2.0 version instead: https://github.com/vuejs/vue-hackernews-2.0

P.S. just tested the 2.0 version with lighthouse and already at 894.6ms time to interactive on desktop :)

@yyx990803 yyx990803 merged commit a4ada13 into vuejs:gh-pages Nov 13, 2016
@addyosmani
Copy link
Contributor Author

@addyosmani addyosmani commented Nov 13, 2016

Lol. I had no idea there was a separate 2.0 version :). I can submit there too. Thanks for the review!

@addyosmani addyosmani deleted the addyosmani:firebase branch Nov 13, 2016
@yyx990803
Copy link
Member

@yyx990803 yyx990803 commented Nov 13, 2016

Hmm, I tried the module import version in v2, but didn't notice a big size win. So I went back and ran v1 using Firebase 2.4.2 and the output build.js was 274kb instead of 448kb. It seems Firebase v3, even using just app and database modules, are not that much lighter than the v2 standalone build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.