Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

Honestly, just delete the barrel files.

13,281 Aufrufe • vor 1 Jahr •via X (Twitter)

14 Kommentare

Profilbild von Jason Miller 🦊⚛
Jason Miller 🦊⚛vor 1 Jahr

🧵 So you think you know Barrel Files

Profilbild von Jason Miller 🦊⚛
Jason Miller 🦊⚛vor 1 Jahr

Problem #1: Dead code

Profilbild von Jason Miller 🦊⚛
Jason Miller 🦊⚛vor 1 Jahr

Problem #2: Reduced clarity

Profilbild von Jason Miller 🦊⚛
Jason Miller 🦊⚛vor 1 Jahr

Problem #3: Accidental import cycles

Profilbild von Jason Miller 🦊⚛
Jason Miller 🦊⚛vor 1 Jahr

Problem #4: Infrastructure strain

Profilbild von Jason Miller 🦊⚛
Jason Miller 🦊⚛vor 1 Jahr

Problem #5: Testing code shipped to production

Profilbild von Jason Miller 🦊⚛
Jason Miller 🦊⚛vor 1 Jahr

Problem #6: "Bin Files"

Profilbild von Jason Miller 🦊⚛
Jason Miller 🦊⚛vor 1 Jahr

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

Profilbild von Jason Miller 🦊⚛
Jason Miller 🦊⚛vor 1 Jahr

A magical debarrel plugin appears

Profilbild von Jason Miller 🦊⚛
Jason Miller 🦊⚛vor 1 Jahr

Tweak your tree shaking configuration (maybe)

Profilbild von Jason Miller 🦊⚛
Jason Miller 🦊⚛vor 1 Jahr

full talk here:

Profilbild von Michael Dougall
Michael Dougallvor 1 Jahr

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

Profilbild von Anton Korzunov
Anton Korzunovvor 1 Jahr

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

Profilbild von Jason Miller 🦊⚛
Jason Miller 🦊⚛vor 1 Jahr

Yeah the impact on jest and TS are big.

Ähnliche Videos