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

Bundle change for Firefox #386

Merged
merged 6 commits into from
Apr 11, 2019
Merged

Bundle change for Firefox #386

merged 6 commits into from
Apr 11, 2019

Conversation

SebastienGllmt
Copy link
Contributor

Note: This PR is based on feature/webpackFour so we can't merge it until the new WASM bindings are done & merged

Background

Historically we haven't been able to submit to Mozilla's addon page because they require every individual file to be < 4MBs. To achieve this in a reasonable way, it made the most sense to upgrade to webpack 4 first but we couldn't do that until we also upgraded the WASM bindings (non-trivial!). However, now that it's all done, we should finally be able to submit!

Contents of this PR

  1. I use the webpack4 splitChunks feature to ensure all files are < 4MBs.
  2. I remove our use of pug for dynamically create HTML at compile time. Instead, I use HtmlWebpackPlugin because it natively has the ability to generate HTLM script includes for every chunk of your application.
  3. I added caching to the babel compilation of our development branch. This made npm run dev run about 20 seconds faster.
  4. Upgrade our bip39 library since the latest version allows us to remove non-English languages. This makes our code a bit smaller but more importantly some non-English languages were triggering Firefox's illegal word policy so this increases our chance of the app being accepted.

Things to consider

I wasn't able to apply the chunking to the dll folder. It looks like the concept of splitting up your code into chunks is NOT supported by the webpack DllPlugin. I tried googling it and most people suggest to just stop using the DllPlugin and rely only on the new chunking system. There are a few complications to this and what I have now in this PR is good enough for Firefox but we will have to figure something out for this because there's nothing stopping it from growing to over 4MBs for one file.

Firefox result

Firefox gives us the okay to submit. All the warnings are unavoidable.

image

@SebastienGllmt SebastienGllmt added the NFC No Functional Change (pure refactoring/cleanup) label Apr 7, 2019
@SebastienGllmt SebastienGllmt mentioned this pull request Apr 7, 2019
8 tasks
@SebastienGllmt SebastienGllmt force-pushed the feature/bundle_optimize branch 2 times, most recently from 7766419 to 58342fb Compare April 9, 2019 03:57
@SebastienGllmt SebastienGllmt mentioned this pull request Apr 10, 2019
@vsubhuman vsubhuman changed the base branch from feature/webpackFour to develop April 11, 2019 13:15
@SebastienGllmt SebastienGllmt merged commit 15ed793 into develop Apr 11, 2019
@SebastienGllmt SebastienGllmt mentioned this pull request Apr 12, 2019
@SebastienGllmt SebastienGllmt deleted the feature/bundle_optimize branch April 12, 2019 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NFC No Functional Change (pure refactoring/cleanup)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants