Catalog: keep the data-products fixtures out of the volumes landing chunk - #5259
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5259 +/- ##
===========================================
- Coverage 55.20% 34.92% -20.28%
===========================================
Files 872 741 -131
Lines 36766 23802 -12964
Branches 6429 6429
===========================================
- Hits 20298 8314 -11984
+ Misses 14724 13744 -980
Partials 1744 1744
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Local code review — findings and dispositionsRan the repo-local review over this layer ( 1. Accepted — the retry generation made the resource key impure
Fixed by carrying the generation in each resource's input, so a reader releases the generation it claimed and One correction to the first write-up of this finding: the throw does not reach the root error boundary and does not blank the catalog. Checked with a boundary wrapped around a surviving sibling — the boundary is not triggered and the sibling stays mounted. It surfaces as an uncaught error, so the cost is a Sentry event per occurrence plus the leak. Worth fixing, but not the catalog-blanking failure 2. Accepted — the retry was per-resource, not per-windowResources only share
The middle row is why the generation is advanced lazily on read rather than on a timer. A timer has to notify its readers to be worth anything, and notifying them re-renders, which re-reads, which retries the import, which fails, which schedules another. Read on the way past, the retry still arrives with the next read, which is what the window promises. The report is deduplicated per generation, and a successful load clears the pending window so the generation stops moving. 3. Accepted —
|
`model/DataProducts/hooks` is on the volumes landing's import path through `useProducts`, so its static `fixtureAdapter` import put the whole 36K demo fixture corpus in the chunk every deployment downloads there -- including the ones with the `data-products` preview off, which never read it. Reach the adapter through a dynamic import instead, in the shape `Tabulator.tsx` already uses for `ConfigEditor`. The corpus gets its own on-demand chunk; the resource keys and the hook signatures do not change. `useAdapter` goes with it: it returned the adapter synchronously, which a lazy adapter cannot do, and it had no callers.
3eac3bd to
1906251
Compare
Trimmed to the minimal changeRuled over-built on read: too much machinery, tests and comments for a change
What came out
The trade this makes — worth a maintainer's eyeThe deleted machinery guarded a real state: if the adapter chunk cannot be I am letting that stand, for three reasons:
If you would rather the containment ship with the bundling change, say so and it The earlier local-review comment above is now mootAll three of its accepted findings governed code that no longer exists: the VerificationThe bundling claim is checked against the build rather than asserted in a spec: StackLayers 2–9 were rebased onto this chain in order and force-pushed with |
Description
With the
data-productspreview off, every deployment still shipped the preview's33 KB demo fixture corpus in the JavaScript a browser downloads for the volumes
landing.
model/DataProducts/hooksis imported there throughuseProducts, andit imported
./fixtureAdapterstatically, so the fixtures rode into that chunkfor customers who never open a data product.
This reaches the adapter through a dynamic import instead, in the shape
Tabulator.tsxalready uses forConfigEditor. The corpus gets its ownon-demand chunk; the resource keys and the hook signatures do not change.
useAdaptergoes with it: it returned the adapter synchronously, which a lazyadapter cannot do, and it had no callers.
Verification
After a production build the fixture corpus (
acme_cohort_2024and its siblings)appears in exactly one async chunk — 13 KB minified, referenced from the runtime's
chunk map — and in none of the three entrypoint assets (
runtime, the vendorchunk,
app).Position in the stack
PR 1 of 9, based on
master. This is the split of #5217 the review asked forin f27,
which named the DataProducts extraction as the one worth making first: it is the
only
app/model-layer change in that PR, the only[Changed], and it depends onnothing else in the set.
TODO
DataProductsspecs; the change is acall-shape change behind unchanged hook signatures
🤖 Generated with Claude Code