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

DS-667 Individual icon JS imports #2369

Merged
merged 3 commits into from
Oct 28, 2021

Conversation

danielamorse
Copy link
Collaborator

@danielamorse danielamorse commented Oct 28, 2021

Jira

https://pegadigitalit.atlassian.net/browse/DS-667

Summary

Import JS icons individually to avoid shipping unused code.

Details

Until we upgrade to Webpack 5, we can't tree shake unused icons. So, we must do this ourselves by importing only what we need. This PR updates the icon build step to output individual files for each icon and updating the components to import them directly.

How to test

  • Delete the ./www/build folder for a clean start
  • Checkout this branch and run yarn start
  • Verify each component that uses JS icons continues to work as expected
  • Inside the ./www/build folder:
    • Search for M25.8 20.5c-3 3.2-6.3 (a string from the "eye" icon, which isn't included anywhere). Verify there are no results.
    • Search for M26.6 12.4c.6-.6.6-1.6 (a string from "chevron-down" icon, which is included in the accordion component). Verify it is there in the build folder.

@github-actions github-actions bot added the type: feature List this PR in the 'Features' section of the release notes. label Oct 28, 2021
@colbytcook colbytcook temporarily deployed to feature/DS-667-icons-single-exports--branch-preview October 28, 2021 14:30 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature List this PR in the 'Features' section of the release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants