3 ms·
With webpack you can use module federation to share code and reduce bundle size for micro-frontend applications. There are other ways to make your application b
by Chyzwar 5y ago
With webpack you can use module federation to share code and reduce bundle size for micro-frontend applications. There are other ways to make your application bundle smaller.
I spend a lot of time optimizing performance at work, both for UX and DX. It is common on HN to bash on large bundle sizes of SPAs, but in reality this not a problem unless users are on IE. At work, I often work tirelessly to reduce the amount of dependencies and bundle size, but I know that this would not make things faster, just more maintainable.
For UX perf killers are IMO:
- rendering large number of deeply nested dom nodes and doing repaints and reflows.
- large data fetches and storing huge number of objects in memory.
- slow/flaky APIs, in many cases slow backend is main bottleneck, JS is plenty fast
- silly animations, bad design that force clicking and multi stage workflows.
For DX perf killers
- micro-something. Micro services/frontend in organistions without deep pockets.
- special snowflakes internal abandoned framework that only two people in company know
- lack of dedicated people for tooling and dev infrastructure
- lava layer design pattern, multiple competing technologies used within same codebase/product.
- dfabulich 5y ago> It is common on HN to bash on large bundle sizes of SPAs, but in reality this not a problem unless users are on IE. This is dangerously wrong. Large bundle sizes are a huge problem on slow Android phones (and almost all Android phones in real-world use are slow). Even in the US, if you walk into a cellular store and ask for an affordable phone, they're going to give you a device that will take 7-10s to download, parse, and execute a 3MB JS bundle, even over wifi. (The parsing alone will kill you!) (And if you're in a developing economy? That "affordable" phone is the best phone you can reasonably buy with a month's wages. The median phone is even slower!)
- Chyzwar 5y agoIn US 55% of people carry iphone. Depending on app, people with affordable phones are not your users (b2b). Browsers would cache parsed javascript. More likly loading images will be slower. There are use cases that general perfomance matter a lot but people are obsesing on js bundle size too much.
- afavour 5y ago> Browsers would cache parsed javascript. First load is important for any public facing site. A 7-10s delay on first load means you’ve lost the game no matter what happens on a second load, because there often won’t be one. > more likely loading images will be slower True, but images do not block interaction with your site. In most SPA situations JS will.
- Dayshine 5y ago> First load is important for any public facing site. A 7-10s delay on first load means you’ve lost the game no matter what happens on a second load, because there often won’t be one. I hear this said a lot, but have never quite understood it myself. What industries have pages that are hit by new customers and need to be a big complicated SPA? Any SaaS can have a landing page/login page which it can use to background load assets needed for the service itself. And if someone already knows of and wants to use your service they'll wait a few seconds. Online shops maybe?
- afavour 5y agoYeah, online shops is a big one that comes to mind. But it’s more connected to this unnecessary proliferation of SPA sites that have no business being set up that way. Some news sites are like that, for example.
- WesolyKubeczek 5y ago> - special snowflakes internal abandoned framework that only two people in company know And remember that today’s darling framework all the internets are raving about is a special snowflake abandoned framework tomorrow that no one gives a damn about anymore. The corollary to this is that the spice must flow, and the wheels must keep spinning, thus the hamsters^Wdevelopers must keep rewriting everything using the current darling languages, frameworks, and paradigms, restlessly contributing to the ever growing carbon footprint as CI/CD pipelines keep chugging away at each oneliner commit!