Repository navigation
docs(migration-skill): use decoVitePlugin in templates + add cleanup checklist - #109
Merged
Merged
Conversation
…checklist Two stale areas in the deco-to-tanstack-migration skill, plus one brand-new reference distilling battle-tested cleanup patterns. ## Changes ### `templates/vite-config.md` — drop ~80 lines of stub duplication The old template inlined the entire `deco-server-only-stubs` plugin (react-dom/server, node:async_hooks, node:stream, node:stream/web, tanstack-head-scripts) — ~60 lines that exactly mirror what `@decocms/start/vite`'s `decoVitePlugin()` already does. The new template uses `decoVitePlugin()` and adds the production-grade boilerplate that real sites actually need (and that the old version omitted): VTEX dev proxy, CSP frame-ancestors header, build sourcemap, PLUGIN_WARNING filter, react-compiler config, `pure: ["console.log"]`, and the full `dedupe` list including `@decocms/start` + `@decocms/apps`. ### `references/vite-config/README.md` — fix "minimal" config that was broken The "post-migration minimal config" was missing `decoVitePlugin()` entirely. Without it, the client bundle crashes on transitively imported server modules. Added the plugin + the minimum dedupe list, and cross-referenced the full template. ### `references/post-migration-cleanup.md` — NEW Dedicated reference distilling the cleanup work that surfaces on every real migration: 1. Detect + delete unused `src/lib/*` shims (with a copy-paste detection script). Real-world data: baggagio-tanstack had 11 generated shims and 0 actual users; casaevideo had 11 generated and 1 used. 2. Drop the `site-manual-chunks` and `deco-stub-meta-gen` inline plugins that are now framework-provided in `@decocms/start >= 2.5.0`. 3. Drop the `runtime.ts` `invoke` shim — `@decocms/start/sdk` exports both `invoke` (singleton) and `createAppInvoke` (typed factory). 4. Drop site-local `withSiteGlobals` workaround — framework helper is now opt-in and tested. 5. Verify VTEX util imports point direct at `@decocms/apps/vtex/...`, not at dead `~/lib/vtex-*` shims (the migration script's stale `phase-cleanup.rewriteVtexUtilImports` was silently regressing them). 6. Search for orphan `TODO: move into framework` comments and either migrate, file an issue, or delete. Plus a verification checklist. ## Why now Validated in this session against three reference sites (casaevideo-storefront, baggagio-tanstack, casaevideo). Each cleanup step has a corresponding shipped or in-flight PR (#103/#106/#107/#108 on framework, #5/#6/#7 on baggagio-tanstack), so the checklist isn't speculative. ## Scope discipline This PR only edits skill content; no source/runtime changes. Both `.agents/skills/` and `.cursor/skills/` copies stay in sync. Made-with: Cursor
|
🎉 This PR is included in version 2.5.0 🎉 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
Three skill updates that capture this week's migration learnings as durable artifacts.
Both `.agents/skills/` and `.cursor/skills/` copies stay in sync.
Detail
templates/vite-config.mdBefore (113 lines): Inlined the entire `deco-server-only-stubs` plugin — `react-dom/server`, `node:async_hooks`, `node:stream`, etc. — plus stub source for each. Pre-dates `decoVitePlugin()`.
After (~190 lines): Uses `decoVitePlugin()` from `@decocms/start/vite`, and adds the production-grade boilerplate real sites actually need but the old template omitted:
Plus a documented section on what older site templates inline (and why this template doesn't), so users on older `@decocms/start` versions know what to add.
references/vite-config/README.mdThe "post-migration minimal config" was missing `decoVitePlugin()` entirely. Without it, the client bundle crashes on transitively imported server modules — `Cannot read properties of undefined (reading 'AsyncLocalStorage')` and similar. The minimal config is now genuinely minimal but actually works, with a pointer to the full template for production sites.
references/post-migration-cleanup.md(new)A dedicated reference distilling the cleanup work that surfaces on every real migration:
Plus a verification checklist.
Why now
Each cleanup step has a corresponding shipped or in-flight PR validating it on real sites:
The checklist isn't speculative.
Scope discipline
Skill content only. No source / runtime / template-script changes. Plan tracker (`MIGRATION_TOOLING_PLAN.md`) intentionally not included — that's a session-scratch document, not the skill.
Test plan
Made with Cursor