Repository navigation
feat: bundling for UI Components - #42549
Merged
raisedadead merged 8 commits intoJun 21, 2021
Merged
raisedadead merged 8 commits into
raisedadead merged 8 commits into
Conversation
huyenltnguyen
left a comment
Member
There was a problem hiding this comment.
Thanks for setting this up, Oliver! 🎉
Member
|
Ugh! Merge conflicts... |
Co-authored-by: Huyen Nguyen <[email protected]>
ojeytonwilliams
force-pushed
the
feat/bundling-for-ui-components
branch
from
June 21, 2021 07:40
9b3c9a8 to
196cb89
Compare
raisedadead
approved these changes
Jun 21, 2021
raisedadead
enabled auto-merge (squash)
June 21, 2021 08:10
huyenltnguyen
approved these changes
Jun 21, 2021
Closed
7 of 43 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Since the UI Components are intended to be self-contained, I've added a basic rollup config that transpiles, tree-shakes, purges tailwind and caters for production and development. In production mode it makes the smallest bundles it can (including stripping out PropTypes), while dev mode is less aggressively optimized and watches the files for changes.
In principle this isn't the correct way to integrate with /learn (since Gatsby applies its own optimisation, including bundling with WebPack). By bundling in advance we deny WebPack the chance to remove duplicates (like Babel helper functions). However, I suspect this makes little difference in practice. We should keep that in mind, though.
@huyenltnguyen I hope this is helpful. Let me know what you think and if there's anything you'd rather was done differently.