Hacker News new | past | comments | ask | show | jobs | submit login

On the other hand, with advancements such as HTTP/2, there's not a substantial reason to pack multiple scripts.



The main reason you pack scripts is because you're compiling, and your compiler is checking and optimizing your cross-file interactions. For example, you need to merge scripts to be able to detect and delete unused functions, because otherwise some unmerged script might call the function without the compiler being able to detect it.


It seems like it would be trivial for your compiler to go ahead and split the files up again afterwards. Its not like you cared about file organization on the client side anyways if you were packing them, so its free to split however it feels.

And ofc you’d naturally just attribute this as an artifact of optimization, just as single-file packing was. Which it is, given http 2/3


No, because if you split it into two pieces, common utility functions will be called from both pieces, at which point you have to duplicate them.

Splitting probably makes sense only for an infrequently used feature, like video chat in an app like Gmail or Slack.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: