Add provider dynamic import example #282
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Your ENS/address: apurn.eth
I moved
Provider
away from_app.tsx
to demonstrate how to dynamically loadwagmi
's Provider.This serves as an answer for #32.
Improvements
Before:
![Screen Shot 2022-03-25 at 12 39 26 AM](https://user-images.githubusercontent.com/14824254/160077524-a55bcca8-c840-4bed-9a30-aa76b35f96d8.png)
First Load JS >300kb across all pages
After:
![Screen Shot 2022-03-25 at 12 44 17 AM](https://user-images.githubusercontent.com/14824254/160077602-973dfc6d-48bd-4cd4-95c0-1882e1e10d22.png)
First load JS on heaviest page (the one where we import
wagmi
without any lazy loading) = 200kbShared JS (~70kb) because we dynamically loaded
wagmi
ANDethers