Skip to content

Commit fc1882d

Browse files
committed
Update migration plan
1 parent 0befbc8 commit fc1882d

File tree

1 file changed

+49
-17
lines changed

1 file changed

+49
-17
lines changed

website/prompts/deco-cx-store-migration-plan.md

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,6 @@ export default defineConfig({
259259
});
260260
```
261261

262-
#### 6.3 Regenerate Manifest
263-
**Action:** Always regenerate `manifest.gen.ts` after app structure changes:
264-
```bash
265-
deno task gen
266-
```
267-
268262
### 7. SEO & Robots.txt Setup
269263

270264
#### 7.1 Add robots.txt
@@ -306,8 +300,9 @@ const ClientOnlyComponent = lazy(() => import("../islands/ClientComponent.tsx"))
306300
## 🚀 Migration Checklist
307301

308302
### Phase 1: Dependencies & Structure
309-
- [ ] Update core deco.cx dependencies to latest stable versions
310-
- [ ] Migrate std library imports to JSR
303+
- [ ] **Start with `deno task update`** - Update all dependencies to latest versions first
304+
- [ ] Update core deco.cx dependencies to latest stable versions (1.120.11+)
305+
- [ ] Migrate std library imports to JSR (handled by deno task update)
311306
- [ ] Remove unnecessary dependencies
312307
- [ ] Clean up DecHub references
313308
- [ ] Restructure apps directory with proper namespacing
@@ -350,6 +345,47 @@ const ClientOnlyComponent = lazy(() => import("../islands/ClientComponent.tsx"))
350345
**Cause:** Missing or outdated SEO components
351346
**Solution:** Migrate to latest SEO component versions
352347

348+
## 📚 Lessons Learned from Real Migration Work
349+
350+
Based on analyzing the miess-01 repository and applying fixes:
351+
352+
### **What Works Well in Existing Stores**
353+
- **Apps structure already migrated**: Many stores have already been updated to use `apps/deco/` namespacing
354+
- **No DecHub references**: Most legacy DecHub cleanup has already been done
355+
- **Good SEO foundation**: Custom SEO components and robots.txt are properly configured
356+
- **Proper image handling**: Many components already use explicit dimensions and Picture components
357+
358+
### 🔧 **Critical Fixes Often Needed**
359+
1. **Dependency versions**: Always update deco.cx core to latest stable (1.120.11+)
360+
2. **Window object guards**: Analytics and client-side code needs `typeof window !== 'undefined'` checks
361+
3. **Search parameter encoding**: Use `encodeURIComponent()` instead of manual string replacement
362+
4. **Image dimensions**: Add explicit `width` and `height` attributes to prevent layout shifts
363+
5. **Fresh config plugins**: Ensure `tailwind` is passed to plugins configuration
364+
365+
### 🎯 **Common Patterns for Window Guards**
366+
```typescript
367+
// ❌ Bad - Direct window access
368+
window.DECO.events.dispatch(event)
369+
370+
// ✅ Good - With guards
371+
if (typeof window !== 'undefined' && window.DECO?.events) {
372+
window.DECO.events.dispatch(event)
373+
}
374+
```
375+
376+
### 🚫 **Don't Need to Regenerate Manifest**
377+
After dependency updates, you DON'T need to run `deno task gen` - this was a misconception in earlier migration guides. The build process handles this automatically.
378+
379+
### 🔄 **Std Import Migration is Automatic**
380+
When you run `deno task update`, Deno automatically handles the migration of `std/` imports to JSR `@std/` imports. **DO NOT** manually change import statements in your code files - let Deno handle this automatically through its dependency resolution.
381+
382+
### **Priority Order for Fixes**
383+
1. **SSR compatibility** (window guards) - prevents runtime errors
384+
2. **Dependency updates** - ensures compatibility and security
385+
3. **Performance optimizations** - image dimensions, async render
386+
4. **Search functionality** - parameter encoding affects UX
387+
5. **Build configuration** - nodeModulesDir, excludes
388+
353389
## 🤖 Evolution Agent Workflow Menu
354390

355391
These are key optimization workflows that can be applied to any deco.cx store:
@@ -388,9 +424,9 @@ These are key optimization workflows that can be applied to any deco.cx store:
388424
# 1. Backup current state
389425
git checkout -b migration-backup
390426

391-
# 2. Update dependencies
392-
echo "Updating dependencies..."
393-
# Update deno.json with latest versions
427+
# 2. Update dependencies (includes automatic std import migration)
428+
echo "Updating dependencies and migrating std imports automatically..."
429+
deno task update
394430

395431
# 3. Clean up structure
396432
echo "Cleaning up DecHub references..."
@@ -401,15 +437,11 @@ rm -f .deco/blocks/Deco\ HUB.json
401437
echo "Configuring async render..."
402438
# Update heavy sections with async configuration
403439

404-
# 5. Regenerate manifest
405-
echo "Regenerating manifest..."
406-
deno task gen
407-
408-
# 6. Run checks
440+
# 5. Run checks
409441
echo "Running checks..."
410442
deno task check
411443

412-
# 7. Test build
444+
# 6. Test build
413445
echo "Testing build..."
414446
deno task build
415447
```

0 commit comments

Comments
 (0)