Skip to content

feat: bundling for UI Components - #42549

Merged
raisedadead merged 8 commits into
freeCodeCamp:mainfrom
ojeytonwilliams:feat/bundling-for-ui-components
Jun 21, 2021
Merged

raisedadead merged 8 commits into
freeCodeCamp:mainfrom
ojeytonwilliams:feat/bundling-for-ui-components

Conversation

@ojeytonwilliams

Copy link
Copy Markdown
Contributor

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.

@ojeytonwilliams
ojeytonwilliams requested review from a team and huyenltnguyen June 17, 2021 17:24
@gitpod-io

gitpod-io Bot commented Jun 17, 2021

Copy link
Copy Markdown

@github-actions github-actions Bot added the scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. label Jun 17, 2021
@raisedadead raisedadead added the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label Jun 18, 2021

@huyenltnguyen huyenltnguyen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for setting this up, Oliver! 🎉

Comment thread tools/ui-components/src/index.js Resolved
huyenltnguyen
huyenltnguyen previously approved these changes Jun 20, 2021

@huyenltnguyen huyenltnguyen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🚢

@huyenltnguyen

Copy link
Copy Markdown
Member

Ugh! Merge conflicts...

@github-actions github-actions Bot added platform: api Server application that needs familiarity with Express, Fastify, MongoDB etc. platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. scope: i18n language translation/internationalization. Often combined with language type label labels Jun 21, 2021
@ojeytonwilliams
ojeytonwilliams force-pushed the feat/bundling-for-ui-components branch from 9b3c9a8 to 196cb89 Compare June 21, 2021 07:40
@freeCodeCamp freeCodeCamp deleted a comment from github-actions Bot Jun 21, 2021
@github-actions github-actions Bot removed platform: api Server application that needs familiarity with Express, Fastify, MongoDB etc. scope: i18n language translation/internationalization. Often combined with language type label scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. labels Jun 21, 2021
@raisedadead
raisedadead enabled auto-merge (squash) June 21, 2021 08:10
@raisedadead
raisedadead merged commit 95dc636 into freeCodeCamp:main Jun 21, 2021
@ojeytonwilliams
ojeytonwilliams deleted the feat/bundling-for-ui-components branch June 21, 2021 09:00
@huyenltnguyen huyenltnguyen mentioned this pull request Jun 29, 2021
7 of 43 tasks
@ahmaxed ahmaxed mentioned this pull request Jan 4, 2022
37 of 49 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants