Loading video...

Video Failed to Load

Go Home

Honestly, just delete the barrel files.

13,281 views • 1 year ago •via X (Twitter)

14 Comments

Jason Miller 🦊⚛'s profile picture
Jason Miller 🦊⚛1 year ago

🧵 So you think you know Barrel Files

Jason Miller 🦊⚛'s profile picture
Jason Miller 🦊⚛1 year ago

Problem #1: Dead code

Jason Miller 🦊⚛'s profile picture
Jason Miller 🦊⚛1 year ago

Problem #2: Reduced clarity

Jason Miller 🦊⚛'s profile picture
Jason Miller 🦊⚛1 year ago

Problem #3: Accidental import cycles

Jason Miller 🦊⚛'s profile picture
Jason Miller 🦊⚛1 year ago

Problem #4: Infrastructure strain

Jason Miller 🦊⚛'s profile picture
Jason Miller 🦊⚛1 year ago

Problem #5: Testing code shipped to production

Jason Miller 🦊⚛'s profile picture
Jason Miller 🦊⚛1 year ago

Problem #6: "Bin Files"

Jason Miller 🦊⚛'s profile picture
Jason Miller 🦊⚛1 year ago

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

Jason Miller 🦊⚛'s profile picture
Jason Miller 🦊⚛1 year ago

A magical debarrel plugin appears

Jason Miller 🦊⚛'s profile picture
Jason Miller 🦊⚛1 year ago

Tweak your tree shaking configuration (maybe)

Jason Miller 🦊⚛'s profile picture
Jason Miller 🦊⚛1 year ago

full talk here:

Michael Dougall's profile picture
Michael Dougall1 year ago

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

Anton Korzunov's profile picture
Anton Korzunov1 year ago

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

Jason Miller 🦊⚛'s profile picture
Jason Miller 🦊⚛1 year ago

Yeah the impact on jest and TS are big.

Related Videos