Bundling JavaScript for Performance: Best Practices
Writing for Perf Planet, David Calhoun shares performance advice on the question of how many scripts a page should load to perform best.
[…] some of your vendor dependencies probably change slower than others.
reactandreact-domprobably change the slowest, and their versions are always paired together, so they both form a logical chunk that can be kept separate from other faster-changing vendor code:
<script src="vendor.react.[hash].min.js"></script>
<script src="vendor.others.[hash].min.js"></script>
<script src="index.[hash].min.js"></script>
The idea has a familiar ring. Writing in 2012 about how many CSS files a given page should load, the same author split requests into global, section-specific, and page-specific files. That breakdown centered less on third-party code, though the same reasoning could apply there as well.



