Skip to content

Consume nemar-cli /<id>/page-bundle.json on dataset detail #71

Closed

Description

@neuromechanist

Background

nemar-cli#618 (the CLI counterpart epic to website#66) ships a new endpoint via nemar-cli#617:

GET https://data.nemar.org/<id>/page-bundle.json?v=<v>

It returns landing + metadata + summary + catalog (+optional qa) in one response, designed to collapse the website's cold-load waterfall to a single RTT.

Website epic #66 (cold-paint perf) intentionally left the bundle consumer out of scope — that epic focused on three independent wins (cache namespace bump, inline summary.readme.content, progressive BIDS tree). The page-bundle consumer is the logical next move.

Why a follow-up issue

This requires touching every SSR fetch on src/pages/dataset/[id].astro:

  • getLandingOutcome(id) / getSummary(id, v) / getMetadata(id) are currently fanned out in parallel; the bundle endpoint replaces all three.
  • The QA path (api.nemar.org/qa/* per nemar-cli#511) is structurally similar and may also fold into the bundle.
  • Backwards compatibility: if the bundle endpoint is unavailable for a given dataset (older versions, transient upstream), the existing fan-out must remain as the fallback.
  • The new summary.readme.content Step 0.5 (website#63 / PR Phase 2 (#63): consume summary.readme.content from schema 1.1 #68) needs to keep working — the bundle's summary shape must be the same.

Acceptance

  • New getDatasetPageBundle(id, v) helper in src/lib/data-api.ts, typed against the schema nemar-cli#617 ships.
  • dataset/[id].astro calls getDatasetPageBundle first; on success it short-circuits the parallel fan-out and feeds the existing components from the bundled response.
  • On failure (404, 503, timeout) it falls back transparently to the current Promise.all([getLandingOutcome, getSummary, getMetadata]).
  • Cold-isolate first paint of /dataset/on005505 drops measurably (target: under 600 ms total).
  • No regression for schema 1.0 datasets, datasets without the bundle endpoint, or the QA path.
  • Unit tests for the new helper (real-shape fixture) + /browse against a Pages preview.

Depends on

  • nemar-cli#617 (backend endpoint must ship + be reachable on data.nemar.org)
  • nemar-cli#618 (the parent CLI epic)

Related

Activity

  1. added
    enhancement
    on May 26, 2026
  2. added a commit that references this issue on May 27, 2026
  3. added 2 commits that reference this issue on May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions