r/programming • • Sep 25 '20

Modern JavaScript Explained For Dinosaurs

https://medium.com/the-node-js-collection/modern-javascript-explained-for-dinosaurs-f695e9747b70
749 Upvotes

167 comments sorted by

View all comments

Show parent comments

5

u/therearesomewhocallm Sep 25 '20

More Disadvantages:

  • Your website takes 30s to load because it waits on one giant JS file when most of it could be loaded on demand.

  • The JS file is large enough that a browser cannot compile-time optimise it.

  • Any webworkers are either inlined (hooray for eval) or run 10x slower.

5

u/zephyy Sep 25 '20 edited Sep 25 '20

Your website takes 30s to load because it waits on one giant JS file when most of it could be loaded on demand.

what is code splitting?

The JS file is large enough that a browser cannot compile-time optimise it.

split & minified JS should never have this problem.

6

u/dnew Sep 25 '20

I am amused that your link loads as a web page and then immediately erases itself on my browser.

1

u/zephyy Sep 25 '20

my b, it included the extra URL query string stuff that google adds for highlighting text

1

u/dnew Sep 25 '20

Ah, cool. Yeah, I hate that Google does that.