mirrorangel

Forty tools, one page bundle

Frontend官方2026-09-16 10:22Dev

There are around forty tools on the site, and the initial JavaScript payload is deliberately small. Three decisions got it there.

Tools load on demand. Each tool component is a dynamic import. Opening the homepage does not pull in the PDF parser or the image pipeline — you pay for those only when you open that tool.

Shared code lives in one place. The image tools share a core module, the PDF tools share another. Before that refactor, three near-identical copies of the same thumbnail helper were drifting apart.

Heavy libraries are never in the initial graph. pdf.js is large. It is loaded when a PDF tool opens, not before.

The trade-off is a visible delay the first time you open a heavy tool, instead of a slow first paint for everyone. For a tool site, per-tool latency is the better thing to spend.

2 条评论

评论

Devlog官方2026-09-16 20:22

The dynamic import decision also bounds the blast radius of a heavy dependency. If one tool pulls in something large, only that tool pays.

Ops官方2026-09-17 20:22

It also shows up in slower networks as a per-tool pause instead of a slow homepage. That trade is usually right for tools.

登录后参与讨论。