question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Investigate tree-shaking opportunities for carbon-components

See original GitHub issue

We use only a small set of functionality from carbon-components in carbon-components-react, specifically settings.prefix, but unfortunately are unable to tree-shake unused parts of vanilla components. This issue is to investigate why and address why these modules are unable to be DCE’d.

  • Additionally evaluate if there could be a carbon icons subfolder where we reexport from there so carbon icons is more tree shakable

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
joshblackcommented, Feb 15, 2021

Hey there @enagorny! Currently, this is tracking for our 2021 Release: https://medium.com/carbondesign/whats-coming-to-carbon-in-2021-39a4c7d1762a We don’t have an umbrella issue yet for this release but when we finalize it we’ll make sure it’s a pinned issue 👍

0reactions
joshblackcommented, May 20, 2021

@jayarjo by default, this should be the case for carbon-components-react. Often times if you are bringing in every component, then there is an import to carbon-components-react/lib/components/* somewhere which is causing the bundle to load CommonJS modules.

This issue originally came up when vanilla JS files from carbon-components were being included in the bundle because of our usage of settings.prefix. Thankfully this should no longer be the case, as well, but we will still move forward with dropping carbon-components from carbon-components-react in the future 😄

Hope this helps!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tree-Shaking Problems with Component Libraries - Medium
Tree -shaking isn't magic, and much like the garbage collector, you need to understand a little of what it's doing to get the...
Read more >
Svelte - Carbon component import breaks debugging
When you use: import { Tile } from 'carbon-components-svelte' ... solution that made sure the source maps work and I still get tree...
Read more >
The wood from the trees: The use of timber in construction
As such, the sustainable harvest of timber from well-managed forests for use in construction presents a real opportunity to sequester more carbon than...
Read more >
carbon-design-system - Bountysource
... but unfortunately are unable to tree-shake unused parts of vanilla components. This issue is to investigate why and address why these modules...
Read more >
Work in progress - Carbon Design System
It's an early opportunity for you to provide feedback and have a say in Carbon's direction. Components and patterns. Tree view component ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found