@decocms/start 0.38.0 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/.agents/skills/deco-migrate-script/SKILL.md +434 -0
  2. package/.agents/skills/deco-to-tanstack-migration/SKILL.md +382 -0
  3. package/.agents/skills/deco-to-tanstack-migration/references/admin-cms.md +154 -0
  4. package/{.cursor/skills/deco-async-rendering-site-guide/SKILL.md → .agents/skills/deco-to-tanstack-migration/references/async-rendering.md} +296 -31
  5. package/.agents/skills/deco-to-tanstack-migration/references/codemod-commands.md +174 -0
  6. package/.agents/skills/deco-to-tanstack-migration/references/commerce/README.md +78 -0
  7. package/.agents/skills/deco-to-tanstack-migration/references/css-styling.md +156 -0
  8. package/.agents/skills/deco-to-tanstack-migration/references/deco-framework/README.md +128 -0
  9. package/.agents/skills/deco-to-tanstack-migration/references/gotchas.md +13 -0
  10. package/{.cursor/skills/deco-tanstack-hydration-fixes/SKILL.md → .agents/skills/deco-to-tanstack-migration/references/hydration-fixes.md} +139 -4
  11. package/.agents/skills/deco-to-tanstack-migration/references/imports/README.md +70 -0
  12. package/{.cursor/skills/deco-islands-migration/SKILL.md → .agents/skills/deco-to-tanstack-migration/references/islands.md} +0 -14
  13. package/.agents/skills/deco-to-tanstack-migration/references/jsx-migration.md +80 -0
  14. package/.agents/skills/deco-to-tanstack-migration/references/matchers.md +1064 -0
  15. package/{.cursor/skills/deco-tanstack-navigation/SKILL.md → .agents/skills/deco-to-tanstack-migration/references/navigation.md} +1 -16
  16. package/.agents/skills/deco-to-tanstack-migration/references/platform-hooks/README.md +154 -0
  17. package/.agents/skills/deco-to-tanstack-migration/references/react-hooks-patterns.md +142 -0
  18. package/.agents/skills/deco-to-tanstack-migration/references/react-signals-state.md +72 -0
  19. package/{.cursor/skills/deco-tanstack-search/SKILL.md → .agents/skills/deco-to-tanstack-migration/references/search.md} +1 -13
  20. package/.agents/skills/deco-to-tanstack-migration/references/signals/README.md +220 -0
  21. package/{.cursor/skills/deco-tanstack-storefront-patterns/SKILL.md → .agents/skills/deco-to-tanstack-migration/references/storefront-patterns.md} +1 -137
  22. package/.agents/skills/deco-to-tanstack-migration/references/vite-config/README.md +78 -0
  23. package/.agents/skills/deco-to-tanstack-migration/references/vtex-commerce.md +165 -0
  24. package/.agents/skills/deco-to-tanstack-migration/references/worker-cloudflare.md +209 -0
  25. package/.agents/skills/deco-to-tanstack-migration/templates/package-json.md +55 -0
  26. package/.agents/skills/deco-to-tanstack-migration/templates/root-route.md +110 -0
  27. package/.agents/skills/deco-to-tanstack-migration/templates/router.md +96 -0
  28. package/.agents/skills/deco-to-tanstack-migration/templates/setup-ts.md +167 -0
  29. package/.agents/skills/deco-to-tanstack-migration/templates/vite-config.md +122 -0
  30. package/.agents/skills/deco-to-tanstack-migration/templates/worker-entry.md +67 -0
  31. package/README.md +45 -0
  32. package/package.json +2 -1
  33. package/src/admin/index.ts +2 -0
  34. package/src/admin/invoke.ts +53 -5
  35. package/src/admin/setup.ts +7 -1
  36. package/src/apps/autoconfig.ts +50 -72
  37. package/src/sdk/invoke.ts +123 -12
  38. package/src/sdk/requestContext.ts +42 -0
  39. package/src/sdk/setupApps.ts +211 -0
  40. package/src/sdk/workerEntry.ts +6 -0
  41. package/.cursor/skills/deco-async-rendering-architecture/SKILL.md +0 -270
@@ -0,0 +1,80 @@
1
+ # JSX Migration — Preact → React Differences
2
+
3
+ > class→className, htmlFor, SVG attrs, createPortal, ComponentChildren, fresh attrs.
4
+
5
+
6
+ ## 4. class vs className
7
+
8
+ Preact accepts both. React only accepts `className`.
9
+
10
+ **Fix**: `grep -rn ' class=' src/ --include='*.tsx'` and replace in JSX contexts.
11
+
12
+
13
+ ## 5. dangerouslySetInnerHTML Syntax
14
+
15
+ Some Deco components use `innerHTML` directly.
16
+
17
+ **Fix**: `dangerouslySetInnerHTML={{ __html: content }}`.
18
+
19
+
20
+ ## 6. ComponentChildren → ReactNode
21
+
22
+ Not just a type rename. Usually fine in practice.
23
+
24
+
25
+ ## 11. SVG Attributes
26
+
27
+ React uses camelCase: `strokeWidth`, `fillRule`, `clipPath`, etc.
28
+
29
+
30
+ ## 20. createPortal Imported from Wrong Module
31
+
32
+ In Preact, `createPortal` is available from `preact/compat` which maps to `react` in some setups. In React, `createPortal` lives in `react-dom`.
33
+
34
+ **Symptom**: `createPortal is not a function` or components using portals (modals, drawers, toasts) silently fail.
35
+
36
+ **Fix**:
37
+ ```bash
38
+ # Find and replace across all files
39
+ grep -r 'createPortal.*from "react"' src/ --include='*.tsx' -l
40
+ # Change to: import { createPortal } from "react-dom";
41
+ ```
42
+
43
+
44
+ ## 21. for Attribute Must Be htmlFor in React JSX
45
+
46
+ Preact accepts both `for` and `htmlFor` on `<label>` elements. React only accepts `htmlFor`. Using `for` causes a hydration mismatch because the server renders `for` but the client expects `htmlFor`.
47
+
48
+ **Symptom**: React #419 hydration errors on pages with labels (search bars, forms, drawers).
49
+
50
+ **Fix**: `grep -r ' for={' src/ --include='*.tsx'` and replace with `htmlFor={`.
51
+
52
+
53
+ ## 22. Fresh-Specific Attributes Must Be Removed
54
+
55
+ Fresh/Preact components may use `data-fresh-disable-lock={true}` on elements. This attribute has no meaning in React and can cause hydration mismatches.
56
+
57
+ **Fix**: Remove all `data-fresh-disable-lock` attributes.
58
+
59
+
60
+ ## 41. Component Props `class` vs `className` Causes Silent Failures
61
+
62
+ **Severity**: HIGH — specific component features silently disappear
63
+
64
+ Gotcha #4 covers JSX attributes (`class=` on HTML elements), but this is about **component props** that are destructured as `class`. Preact components often destructure `{ class: _class }` from props because Preact accepts both `class` and `className`. In React, only `className` is passed, so `_class` ends up as `undefined`.
65
+
66
+ **Symptom**: The Drawer component's `className="drawer-end"` never reaches the rendered div. CartDrawer renders without `drawer-end`, making it overlay the wrong side or not render at all.
67
+
68
+ **Fix**: In component interfaces, accept both and merge:
69
+
70
+ ```typescript
71
+ // Before (Preact-style):
72
+ function Drawer({ class: _class, ...rest }) {
73
+ return <div className={`drawer ${_class}`}>
74
+
75
+ // After (React-compatible):
76
+ function Drawer({ className, ...rest }) {
77
+ return <div className={`drawer ${className ?? ""}`}>
78
+ ```
79
+
80
+ Search for `class:` in component destructuring patterns across all files, not just in JSX attributes.