Skip to content

docs(skills): invoke-registry-parity — Fresh vs TanStack loader registration#191

Open
JonasJesus42 wants to merge 1 commit into
mainfrom
docs/skill-invoke-registry-parity
Open

docs(skills): invoke-registry-parity — Fresh vs TanStack loader registration#191
JonasJesus42 wants to merge 1 commit into
mainfrom
docs/skill-invoke-registry-parity

Conversation

@JonasJesus42

@JonasJesus42 JonasJesus42 commented May 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds .claude/skills/invoke-registry-parity/SKILL.md documenting the architectural difference between Fresh (`@deco/deco`) and TanStack (`@decocms/start`) in how the invoke registry is populated.

In Fresh, `manifestGen.ts` walks every file under `src/loaders/`, `src/actions/` and registers all of them. In TanStack, `scripts/generate-loaders.ts` filters by `__resolveType` references in `.deco/blocks/` when called with `--decofile-dir`, so code-only invocations (header components, hooks, effects) silently 404.

This caused the Bagaggio delivery-promise drawer + popup to never populate after migration. Fix on the site side was dropping `--decofile-dir` from `package.json`'s `generate:loaders`.

Related issues

Test plan

  • Skill renders correctly when invoked via Claude Code's Skill tool
  • Cross-references to other skills (`[[deco-htmx-cache-contamination]]`) resolve

🤖 Generated with Claude Code


Summary by cubic

Adds .claude/skills/invoke-registry-parity/SKILL.md explaining why loaders/actions can 404 after migrating from @deco/deco (Fresh) to @decocms/start (TanStack), and how to fix it. This helps teams unblock runtime.site.loaders.X calls that return undefined.

  • New Features
    • Documents Fresh auto-discovery vs TanStack prune-by-decofile in generate-loaders.ts.
    • Shows the 404 symptom for /deco/invoke/site/loaders/* and how to detect missing registry entries.
    • Provides site fixes: remove --decofile-dir or manually register loaders/actions.
    • References follow-up framework work (opt-in prune, dev-mode fallback).
    • Includes a real-world case (Bagaggio) with steps and verification.

Written for commit 1c322fc. Summary will update on new commits. Review in cubic

…tration

Document the architectural difference between @deco/deco (Fresh, walks
every file into manifest.gen.ts) and @decocms/start (TanStack, prunes
loaders/actions not referenced by .deco/blocks when generate-loaders.ts
is called with --decofile-dir).

Symptom: runtime.site.loaders.X returns undefined and the network tab
shows /deco/invoke/site/loaders/X → 404. Common when migrating Fresh
storefronts that invoke loaders from React code instead of the CMS.

References the two follow-up framework issues:
- #189 — flip prune to opt-in
- #190 — dev-mode filesystem fallback

Real-world hit: deco-sites/baggagio-tanstack delivery-promise drawer.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@JonasJesus42 JonasJesus42 requested a review from a team May 20, 2026 14:20

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".claude/skills/invoke-registry-parity/SKILL.md">

<violation number="1" location=".claude/skills/invoke-registry-parity/SKILL.md:194">
P2: Cross-reference `[[deco-htmx-cache-contamination]]` links to a skill file that does not exist in this repository. Either create that file or remove the reference.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

- The `@decocms/start` invoke route is `/deco/invoke/...`. Fresh's was `/live/invoke/...`. Both shapes are still accepted on the handler.
- `setupApps()` in `@decocms/apps` uses `registerInvokeHandlers()` (additive registry) for VTEX/Shopify keys — independent of `setInvokeLoaders()`. The site-side `generate-loaders.ts` only governs `site/*` keys.
- The same pruning logic also drops loaders that aren't referenced by `__resolveType` even if they're imported in code via `runtime.site.loaders.X`. The static analyzer doesn't see those runtime-string keys.
- This is closely related to (but distinct from) `[[deco-htmx-cache-contamination]]` — that one is about SSR-cached HTML leaking cookies, this is about invoke routing.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Cross-reference [[deco-htmx-cache-contamination]] links to a skill file that does not exist in this repository. Either create that file or remove the reference.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .claude/skills/invoke-registry-parity/SKILL.md, line 194:

<comment>Cross-reference `[[deco-htmx-cache-contamination]]` links to a skill file that does not exist in this repository. Either create that file or remove the reference.</comment>

<file context>
@@ -0,0 +1,206 @@
+- The `@decocms/start` invoke route is `/deco/invoke/...`. Fresh's was `/live/invoke/...`. Both shapes are still accepted on the handler.
+- `setupApps()` in `@decocms/apps` uses `registerInvokeHandlers()` (additive registry) for VTEX/Shopify keys — independent of `setInvokeLoaders()`. The site-side `generate-loaders.ts` only governs `site/*` keys.
+- The same pruning logic also drops loaders that aren't referenced by `__resolveType` even if they're imported in code via `runtime.site.loaders.X`. The static analyzer doesn't see those runtime-string keys.
+- This is closely related to (but distinct from) `[[deco-htmx-cache-contamination]]` — that one is about SSR-cached HTML leaking cookies, this is about invoke routing.
+
+## Bagaggio incident — exact reproduction (2026-05)
</file context>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant