perf(router): expose preloadStaleTime + add pdp-fast-navigation skill - #7
Merged
Conversation
createDecoRouter only exposes defaultPreload (no defaultPreloadStaleTime, GcTime, or Delay), so prefetch results may be considered stale by the time the user clicks — causing a wasted second fetch. Replace createDecoRouter with createTanStackRouter direct, re-importing the Deco search parsers (decoParseSearch/decoStringifySearch) so URL behavior is unchanged. Add: - defaultPreloadStaleTime: 60_000 - defaultPreloadGcTime: 5 * 60_000 - QueryClient staleTime: 60_000 (was 30_000) Result: hover prefetch is reused on click within 60s — typical product card → PDP navigation becomes instant. Also add .cursor/skills/deco-pdp-fast-navigation/SKILL.md documenting the full pattern (4 levers + anti-CLS) discovered while optimizing baggagio-tanstack. Storefronts cloned from this template inherit both the router config and the skill. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
Preview deployed
|
The skill is now in @decocms/start/.cursor/skills/deco-pdp-fast-navigation (see decocms/deco-start PR #174), so it's inherited via npm instead of duplicated in the template. Removing the local copy avoids drift. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced May 13, 2026
Merged
….2.1 The bypass (createTanStackRouter direct + decoParseSearch re-imports) was necessary because createDecoRouter on 5.1.1 did not expose defaultPreloadStaleTime, GcTime, etc. @decocms/start@5.2.1 (from decocms/blocks#174) now exposes those options natively. Drop the bypass and use createDecoRouter — same behavior, fewer imports, no FRAMEWORK-ISSUE marker needed. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@decocms/start 5.2 moved generator scripts from scripts/*.ts to bundled dist/scripts/*.cjs (PR #166). Update package.json to invoke them with node instead of tsx, from the new path. Without this, bun run build fails with ERR_MODULE_NOT_FOUND on scripts/generate-blocks.ts because that file no longer exists in the published package — only the compiled .cjs does. Includes meta.gen.json + loaders.gen.ts regen from the build that now actually runs to completion. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Configuração de prefetch + remoção da skill local (movida para o framework).
1.
src/router.tsx—createTanStackRouterdireto comdefaultPreloadStaleTimeSubstitui
createDecoRouter(que em@decocms/start@5.1.1não expõedefaultPreloadStaleTime) porcreateTanStackRouterdireto, reusandodecoParseSearch/decoStringifySearch.Configurações:
defaultPreloadStaleTime: 60_000— hover prefetch reusado por 60sdefaultPreloadGcTime: 5 * 60_000— mantém em memória 5minQueryClient.staleTime: 60_000(antes era 30_000)Resultado: hover em product card + click dentro de 60s → navegação instantânea (cache hit, sem segundo fetch).
2.
.cursor/skills/deco-pdp-fast-navigation/— removidoA skill foi movida para o framework
@decocms/start/.cursor/skills/deco-pdp-fast-navigation/SKILL.mdem decocms/blocks#174. Storefronts cloned desse template + dependentes de@decocms/startherdam a skill via npm — não precisa duplicar.Files changed
src/router.tsx—createTanStackRouterdireto com preload options.cursor/skills/deco-pdp-fast-navigation/SKILL.md— deletado (movido pro framework)Test plan
bun run typecheckpassa limpo?filter.brand=Nike&filter.brand=Adidasround-trips correto)@decocms/start/.cursor/skills/)Status do release do framework
PR decocms/blocks#174 foi merged mas o release CI falhou no
@semantic-release/git pushparamainpor causa da branch protection rule (Changes must be made through a pull request). Conseqüência: npm continua em5.1.1, sem as novas opções de preload emcreateDecoRouter.Opções para destravar:
@semantic-release/gitpor estratégia que não precise push em main (ex: tag-only)npm publisha partir do main local atualizadoApós release publicado, este PR pode ter follow-up para voltar a
createDecoRouternativo.🤖 Generated with Claude Code