Skip to content

@ogygia/data-shake

Seed report

Each build prints a page seed line, how many islands read page.data and how many were pinned to keys, and names each module that made an island ship all of it, with the line and the reason. The profiler shows the same answer in dev.

On this page

A read that can’t be pinned costs nothing visible: the page works, it just ships more. So the build says what it did, every time.

Build line

When the client build finishes, and some island reads page.data, the build prints one line (page_seed_report): how many islands read page.data, how many were pinned and to how many keys in all, and how many ship all of it.

Under it, one line per module that made an island ship everything, with its path, its line and the reason, up to eight, then a count of the rest. Fix those lines and the count of islands that ship all of it drops.

A module that hands the page to a helper names the helper in its reason (the whole page is passed to `trackPage(…)`), with why the helper couldn’t be followed: it couldn’t be resolved, it hands the page on, or it sits behind four or more re-exports. That last reason says “more than 4 re-exports” today, though four is already too many (#2313).

When an island reads the page only through code the build never saw, such as a dependency’s module or a federated fragment, there’s no line to name, and the report says so.

page seed: 12 islands read page.data — 10 pinned to 7 keys, 2 ship all of it
  src/lib/analytics.ts:14 — the whole page escapes (passed on, returned, spread, exported or compared)
  src/lib/Meta.svelte:6 — `page.data` is handed whole to describe(…)

Without the plugin

The report needs dataShake(). Without it, nothing is pinned, every island that reads page ships all of page.data, and the build prints no seed line.

Profiler

In dev, the seed ships whole, but the analysis still runs for the SSR profiler. Its page seed view lists every key with its size and why it ships, greys out the keys shaping would leave out, and its seed-whole and seed-whole-read findings point at the island and the line that make everything ship.