chore: stater updates to integrate with skill#1154
chore: stater updates to integrate with skill#1154benlife5 merged 8 commits into2026-custom-components-templatesfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
WalkthroughThis PR adds Mantine integration and a Puck preview mode to the starter: updates dependencies (React, Mantine, Radix consolidation), adds a Sequence DiagramsequenceDiagram
actor User
participant Browser as "Browser / URL"
participant DevTemplate as "Dev Template (dev.tsx)"
participant LocalStorage as "localStorage"
participant PuckRender as "@puckeditor/core Render"
participant Editor as "Yext Editor"
User->>Browser: Open page (may include preview=true)
Browser->>DevTemplate: Mount with query params
DevTemplate->>DevTemplate: Check URL for preview=true
alt Preview Mode
DevTemplate->>LocalStorage: Read preview key (computed hash)
LocalStorage-->>DevTemplate: Return compressed history
DevTemplate->>DevTemplate: Decompress (lz-string) & parse, extract latest state.data
DevTemplate->>PuckRender: Render with currentPuckData
DevTemplate->>DevTemplate: Register window storage listener
User->>LocalStorage: Update preview data in another tab
LocalStorage-->>DevTemplate: storage event fired
DevTemplate->>DevTemplate: Refresh currentPuckData
DevTemplate->>PuckRender: Re-render with updated data
else Normal Mode
DevTemplate->>Editor: Render Editor UI (VisualEditorProvider)
User->>DevTemplate: Click "Open Preview"
DevTemplate->>Browser: Append preview=true to URL and navigate
end
Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
starter/src/templates/dev.tsx (1)
45-53: Consider documenting the hash function's collision tolerance.The
hashCodefunction uses a simple string hash that can produce collisions for different URLs. For local dev storage keys this is likely acceptable, but a brief comment would clarify the intent and acceptable collision risk.📝 Optional: Add clarifying comment
+/** + * Simple string hash for generating localStorage keys. + * Collisions are acceptable for local dev preview storage. + */ const hashCode = (value: string): number => { let hash = 0;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@starter/src/templates/dev.tsx` around lines 45 - 53, The hashCode function uses a simple non-cryptographic string hash that can produce collisions; add a brief clarifying comment above the hashCode definition stating that this function is intentionally lightweight for local dev storage keys, that occasional collisions are acceptable for this use-case, and note any implications (e.g., not suitable for security or uniqueness guarantees) so future readers understand the risk and intent when using hashCode.starter/tsconfig.json (1)
14-15: Consider simplifying theexcludearray.The
../node_modulespath is unusual sincetsconfig.jsonis at thestarter/root. TypeScript's default behavior already excludesnode_modulesfrom compilation. The relative parent path may be a remnant from a different directory structure.🧹 Suggested simplification
- "exclude": ["../node_modules", "node_modules"] + "exclude": ["node_modules"]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@starter/tsconfig.json` around lines 14 - 15, Remove the unnecessary "../node_modules" entry from the tsconfig.json "exclude" array (and optionally remove the entire "exclude" array since TypeScript excludes "node_modules" by default); edit the "exclude" array that currently contains "../node_modules" and "node_modules" so it only contains "node_modules" or delete it entirely to simplify the config and avoid referencing an incorrect parent path.starter/package.json (1)
49-49: Minor version format inconsistency forreact-is.The dependency uses an exact version (
18.3.1) while the override uses a caret (^18.3.1). Consider aligning them for consistency—either both exact or both with caret range.🧹 Suggested alignment (prefer exact to match dependency)
"overrides": { "vite": { "rollup": "npm:`@rollup/wasm-node`@^4.59.0" }, - "react-is": "^18.3.1" + "react-is": "18.3.1" }Also applies to: 74-76
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@starter/package.json` at line 49, Dependency version for react-is is inconsistent between the main dependency and overrides — change the package entry "react-is": "18.3.1" to match the override format (or vice versa) so both use the same semantic form; identify the package.json entries named "react-is" in dependencies and in overrides and update them to the same format (prefer exact version "18.3.1" to match the dependency, or change both to "^18.3.1" if you prefer range) and apply the same normalization to the other affected entries referenced in the comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@starter/src/templates/dev.tsx`:
- Around line 225-231: isPreviewMode is being read during render from
window.location which causes SSR/client hydration mismatch; change the
implementation to compute isPreviewMode on the client after mount (e.g.
initialize a React state like [isPreviewMode, setIsPreviewMode] via useState
with a safe default false and then set it inside useEffect by reading new
URLSearchParams(window.location.search).get("vePreview") === "1"), and keep
previewStorageKey as a useMemo or compute it similarly on the client if it
depends on window; update any code using isPreviewMode to rely on the state
variable instead of the current top-level const to avoid hydration mismatches
(references: isPreviewMode, previewStorageKey,
getVisualConfigLocalStorageKeyForDev).
---
Nitpick comments:
In `@starter/package.json`:
- Line 49: Dependency version for react-is is inconsistent between the main
dependency and overrides — change the package entry "react-is": "18.3.1" to
match the override format (or vice versa) so both use the same semantic form;
identify the package.json entries named "react-is" in dependencies and in
overrides and update them to the same format (prefer exact version "18.3.1" to
match the dependency, or change both to "^18.3.1" if you prefer range) and apply
the same normalization to the other affected entries referenced in the comment.
In `@starter/src/templates/dev.tsx`:
- Around line 45-53: The hashCode function uses a simple non-cryptographic
string hash that can produce collisions; add a brief clarifying comment above
the hashCode definition stating that this function is intentionally lightweight
for local dev storage keys, that occasional collisions are acceptable for this
use-case, and note any implications (e.g., not suitable for security or
uniqueness guarantees) so future readers understand the risk and intent when
using hashCode.
In `@starter/tsconfig.json`:
- Around line 14-15: Remove the unnecessary "../node_modules" entry from the
tsconfig.json "exclude" array (and optionally remove the entire "exclude" array
since TypeScript excludes "node_modules" by default); edit the "exclude" array
that currently contains "../node_modules" and "node_modules" so it only contains
"node_modules" or delete it entirely to simplify the config and avoid
referencing an incorrect parent path.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 982101be-5162-46d9-944c-135fbc21df26
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
starter/package.jsonstarter/postcss.config.mjsstarter/src/templates/dev.tsxstarter/src/ve.config.tsxstarter/tsconfig.json
Can you explain why we need the localDev preview? Is it just previewing how the live page looks outside of the editor? |
|
Oops sorry @jwartofsky-yext, I thought I had pushed my changes |
Various updates for the starter to integrate better with the skill
<Render>