Speeding up the JavaScript ecosystem
marvinh.dev·117w
Preview
Report Post

📖 tl;dr: Many projects are littered with files that just re-export other files. These so called "barrel files" are one of the key reasons why JavaScript tooling is slow in bigger projects.

Let’s imagine you are working on a big project with many files. You add a new file to work on a new feature and import a function from another directory into your code.

import { foo } from "./some/other-file";export function myCoolCode() {	// Pretend that this is super smart code :)	const result = foo();	return result;}

Excited about finishing your feature, you run the code and realize that it takes an awfully long time to complete. The code you’ve written is pretty straight forward and shouldn’t consume that much time. Concerned by this, you sprinkle in some measuring code to see how…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help