🗣[Discussion] Distribute individual bundles for each component
See original GitHub issueIt would be awesome if I could import only a single component at a time by going a bit deeper into the filesystem, for example something like:
import Flex from '@primer/components/dist/Flex';
// or maybe even
import Flex from '@primer/components/Flex';
That mainly requires creating a JS file per component that has a module.exports
instead of a single index.esm.js
file. That would allow my app to only pull in the code that I am really using, instead of all components, and also solve #455 and #454.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
5 Techniques for Bundle Splitting and Lazy Loading in React
Bundling Javascript code into several files is known as bundle splitting. ... Dynamic imports enable every component to play the role of a ......
Read more >Best Practices For Distributing And Promoting Your NFTs To ...
Furthermore, and besides the aesthetic part, owning your NFT contract means that you can import it in third-party marketplaces that allow for ...
Read more >Code Splitting with Laurie Barth - DEV Community 👩💻👨💻
Excerpt: "According to MDN, 'Code splitting is the splitting of code into various bundles or components which can then be loaded on-demand or...
Read more >تويتر \ Alex / KATT 🐱 (alexdotjs@) - Twitter
With tRPC + Next.js 13, you'll have your components render on the edge but be able to have the "server logic" in a...
Read more >AIcrowd | Data Purchasing Challenge 2022
Distribution shifts have to be anticipated. In this competition, you face these data purchasing challenges in the context of an multi-label ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mxstbr this is possible, but it’s not a great public API because in order for people to use it they need to know how to configure [insert your build tool(s) here] to compile our source files
node_modules/@primer/components
. If there’s a generally acceptable way to do that, we’re all ears! But it seems like having CommonJS and/or ESM builds of each component would be best, no?I’m picking up this issue again. Some recent discussion:
@primer/components
exportdeclare module
directories in theindex.d.ts
file so that bothsrc
anddist
work (or maybe we should dropsrc
and only usedist
?)