Skip navigation
Honestly, just delete the barrel files.
0:00 / 0:26

Honestly, just delete the barrel files.

Jason Miller 🦊⚛

@_developit64K followers

Visit on X
99 likesDownloadOriginal post

13,295 views

Honestly, just delete the barrel files.

14 Comments

Comments from the original post on X (Twitter)

  • Jason Miller 🦊⚛'s profile picture

    @_developit

    🧵 So you think you know Barrel Files

    740 likes

  • Jason Miller 🦊⚛'s profile picture

    @_developit

    Problem #1: Dead code

    32 likes

  • Jason Miller 🦊⚛'s profile picture

    @_developit

    Problem #2: Reduced clarity

    22 likes

  • Jason Miller 🦊⚛'s profile picture

    @_developit

    Problem #3: Accidental import cycles

    22 likes

  • Jason Miller 🦊⚛'s profile picture

    @_developit

    Problem #4: Infrastructure strain

    26 likes

  • Jason Miller 🦊⚛'s profile picture

    @_developit

    Problem #5: Testing code shipped to production

    17 likes

  • Jason Miller 🦊⚛'s profile picture

    @_developit

    Problem #6: "Bin Files"

    17 likes

  • Jason Miller 🦊⚛'s profile picture

    @_developit

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

    17 likes

  • Jason Miller 🦊⚛'s profile picture

    @_developit

    A magical debarrel plugin appears

    62 likes

  • Jason Miller 🦊⚛'s profile picture

    @_developit

    Tweak your tree shaking configuration (maybe)

    16 likes

  • Jason Miller 🦊⚛'s profile picture

    @_developit

    full talk here:

    127 likes

  • Michael Dougall's profile picture

    @dougesdev

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

    4 likes

  • Anton Korzunov's profile picture

    @theKashey

    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

    2 likes

  • Jason Miller 🦊⚛'s profile picture

    @_developit

    Yeah the impact on jest and TS are big.