Video wird geladen...
Video konnte nicht geladen werden
Honestly, just delete the barrel files.
13,281 Aufrufe • vor 1 Jahr •via X (Twitter)
14 Kommentare

🧵 So you think you know Barrel Files

Problem #1: Dead code

Problem #2: Reduced clarity

Problem #3: Accidental import cycles

Problem #4: Infrastructure strain

Problem #5: Testing code shipped to production

Problem #6: "Bin Files"

Some solutions! To start... can linting help?

A magical debarrel plugin appears

Tweak your tree shaking configuration (maybe)

full talk here:

@flexdinesh 4r. Shopify sending it for no barrel? Atlassian started migrating Jira recently, huge improvements across the board

We just did that Rewrote all imports directly to what they need and deleted thousands of barrel files It helped not only with bundling, but boosted tests and even typescript

Yeah the impact on jest and TS are big.
