Repository navigation
docs(migration-skill): farmrio-storefront wave — gotchas #52-#73, learnings-staging convention - #457
Merged
Merged
Conversation
…rnings-staging convention Consolidates the farmrio-storefront Fresh→TanStack migration's staged learnings (migration/learnings/, ~69 targets) into this skill's reference docs, per the epic's own T40 target (deco-sites/farmrio-storefront@migration/targets/T40-learnings-to-blocks.md). 22 new numbered gotchas (#52-#73), each with Severity/Symptom/Root cause/Fix/discovery command/empirical farmrio evidence, distributed into their existing topic files: - async-rendering.md: dead 3-arg ctx section loaders (#52, ~28-file sweep, site-wide dead cookie-consent banner), registration-key mismatch (#53), typeof Component === "function" always-false pattern (#54), no response-mutation sink for section loaders (#73) - hydration-fixes.md: DeferredSectionWrapper skeleton remount/CLS (#55, cross-ref #448) + content-refresh-safe Lazy.tsx unwrap pattern, LoadingFallback wrapper-vs-alias (#56), native listener stopPropagation killing React synthetic events (#57), controlled input missing onChange (#58) - vtex-commerce.md: multivariate-flag resolveType hardcoding (#59, blocker), redirect self-loop via case-fold collision (#60, cross-ref #391), raw URL-param auto-injection (#61), missing similars/isSimilarTo (#62), oversized hydration payload from full nested variants (#63), publicUrl protocol mismatch (#64) - css-styling.md: DaisyUI theme slot mismapping (#65), v5 dark-theme auto-bundling (#66), CLS aspect-ratio fallback cropping wide banners (#67) - worker-cloudflare.md: CF Static Assets cache-control bypass (#68), device-segmented cache poisoning via SWR revalidation (#69, novel), registerCacheableSections request-context gap (#70, novel), client-bundle secret leak via invoke dispatch table (#71, security) - storefront-patterns.md: sitemap not auto-wired (#72) Also adds references/migration-learnings-staging.md, proposing the index-per-target-file learnings convention (INDEX.md + one file per target) as the *starting* pattern for the next migration, citing this epic's flat-file cost (280KB/3,875 lines, 60k+ tokens per catch-up read) as the empirical reason it was restructured mid-epic instead. Codemod/audit-rule proposals for packages/blocks-cli and parity-destined findings are in the PR description, not implemented here (proposal is sufficient per the source target's DoD; implementation is a bonus). Co-Authored-By: Claude Sonnet 5 <[email protected]>
nicacioliveira
previously approved these changes
Aug 13, 2026
- #52: ctx is no longer always undefined (framework fixed via issue #305, landed before this PR); reframe Fix as ctx-free alternative, not mandatory - #61: discovery rg command had unbalanced parens and didn't compile; split into two valid rg calls - #63: filter checked "@type" (always "UnitPriceSpecification") instead of priceComponentType, so the trim silently matched nothing; fixed the field - #65: discovery step was prose, not a runnable command; added grep+jq pair - #66: v5-only gotcha wasn't flagged as such in an otherwise v4 file; added an applicability note - #72: fix had no code example unlike every other BLOCKER/HIGH gotcha; added one, correcting the import path typo present in the source JSDoc itself (@decocms/apps/vtex/... -> @decocms/apps-vtex/...) Co-Authored-By: Claude Sonnet 5 <[email protected]>
JonasJesus42
approved these changes
Aug 17, 2026
|
🎉 This PR is included in version 7.43.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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
Consolidates the farmrio-storefront Fresh→TanStack migration's staged learnings (
migration/learnings/, ~69 completed targets, coverage-verified against the live ledger) into this skill's reference docs, per the epic's own consolidation target (T40).22 new numbered gotchas (#52–#73), each carrying Severity, Symptom, Root cause, Fix (with code), a discovery
rg/grepcommand, and empirical farmrio evidence (file counts, byte deltas, before/after numbers, cross-refs). Distributed into the existing topic files rather than one new dump file, matching this repo's own index-per-topic convention:async-rendering.mdctxsection loaders — 28-file sweep, one was a site-wide dead cookie-consent bannerhydration-fixes.mdDeferredSectionWrapperskeleton remount/CLS (cross-ref #448) + a content-refresh-safeLazy.tsxunwrap patternvtex-commerce.mdcss-styling.mdworker-cloudflare.mdstorefront-patterns.mdsitemap.xmlnot auto-wiredreferences/migration-learnings-staging.md(new file) proposes the index-per-target-file learnings convention as the starting pattern for the next migration's own staging area — citing this epic's own flatLEARNINGS.md(282,249 bytes / 3,875 lines / 103 entries, costing target sessions 60k+ tokens just to search before it was restructured mid-epic on 2026-07-30) as the empirical case for adopting it from day one instead. Linked fromSKILL.md's reference index.Two gotchas (#55, #59) reference upstream PRs/issues already filed from this same migration: decocms/blocks#448 (
DeferredSectionWrapperfix, open) and decocms/blocks#391 (URL param coercion, referenced by #61).Codemod / audit-rule proposals for
packages/blocks-cliProposal only (per this migration's own DoD, implementation is a bonus, not required) — each was hit ≥3 times independently across the farmrio migration:
(props, req, ctx)loader exports, cross-referenced againstregisterSectionLoaderscalls and each file's real__resolveType(not its file path) inblocks.gen.json. Would have caught all 28 candidate files in gotcha fix(migrate): ts-ignore → ts-expect-error + HTMX detection #52 at migration time.typeof X === "function"guard sweep — flag this pattern on any value that originates from CMS section resolution (gotcha feat: unified cache profile system with SWR + SIE #54); recurred independently in 6+ files across the epic.onChangesweep —checked={...}JSX prop with no siblingonChange(gotcha fix: wrap worker fetch in RequestContext.run() #58); found and fixed independently 3 separate times.LoadingFallbackwrapper-function → literal-alias codemod — rewriteexport function LoadingFallback(props) { return <X {...props}/>; }toexport const LoadingFallback = X;(gotcha feat: Chrome Performance trace comparison script #56).blocks.gen.jsonredirect block wherenormalize(from) === normalize(to)after case-folding (gotcha fix(seo): always emit <meta name="robots"> in CMS page head #60); found 3 live instances across 2 targets once the check existed as an ad-hoc script.width/heightback into CMS content, instead of leaving every un-dimensioned image to hit the CLS-safety-net fallback one page at a time (gotcha feat(otel): auto-instrument Workers via OTEL env vars #67).deco-post-cleanup --strictcomment/string-literal awareness — several existing audit rules (deco-cx-runtime-api,style-string-props,htmx-residue) are literal-substring scans with no AST/JSX awareness, so they false-positive on matches inside comments or inside adangerouslySetInnerHTMLHTML string. Farmrio counts: 7 comment-only false positives on one rule, 4 on another, 4-of-6 on a third.Parity-destined findings
Filed separately against
decocms/parity(issue, cross-linked frommigration/learnings/INDEX.mdin farmrio-storefront) rather than bundled into this PR — covers--fail-onrequiring--ci,--pagesnot scopingflows, abanner-aspect-ratiocheck double-counting infinite-carousel clones, alazy-section-presenceheuristic incompatible with TanStack's transport, and LLM visual-diff hallucination on downscaled full-page screenshots.Test plan
gotchas.mdnumbering (fix: add ./apps/autoconfig to package.json exports #51 was the prior max, confirmed viagrep -rn "^## #\?[0-9]" *.md)migration/learnings/T<ID>.mdfile indeco-sites/farmrio-storefront🤖 Generated with Claude Code
Summary by cubic
Consolidates Farm Rio Fresh→TanStack migration learnings into this skill and adds 22 numbered gotchas (#52–#73). Also documents an index-per-target-file staging convention to keep future migrations fast and cheap.
#3053‑arg loader pitfalls,DeferredSectionWrapperCLS, multivariate resolver gaps, sitemap wiring, cache behavior, and a client-bundle secret leak. Cross‑refs:decocms/blocks#448anddecocms/blocks#391.references/migration-learnings-staging.mdand links it fromSKILL.mdto replace flat learnings with an index-per-target approach.Doc updates since review
@decocms/blocksnow supports an optional 3rdctxarg when registered; positions the fix as a ctx‑free alternative for pre‑#305or unregistered loaders.rgcommands.priceComponentType(not@type), ensuring installment entries are removed.grep+jq) for DaisyUI slot mapping.worker-entry.tswiring example for/sitemap.xmland fixes the import path to@decocms/apps-vtex.Written for commit 919eb12. Summary will update on new commits.