fix: unblock fresh-clone editor boot#683
Conversation
Findings from a fresh-worktree dry run. Contributors running
`pnpm install && pnpm dev:editor` on a clean checkout hit three issues
before they can click anything:
- `/canvas` hangs on a spinner forever. `wasm-locate-file.ts` hardcodes
`http://localhost:4020/dist/` as the dev fallback, which is only served
after `just build canvas wasm` (emsdk, ninja, ~10 min first build).
Let dev mode fall through to the unpkg-published wasm when the opt-in
env var is unset; comment the var out in `.env.example` so it's off by
default and labeled as an override for canvas-engine work.
- The landing page throws `Maximum update depth exceeded` on every load
from `FullscreenLoadingOverlay`. `startTime` was a `useState` listed in
the effect's dep array while also being set inside the effect — classic
loop. Switch to `useRef`; semantics preserved (latch on enter, read on
exit).
- The landing page also logs empty-`src` / `blurWidth`/`blurHeight` DOM
warnings on first paint. `BigImageContainer` was spreading a
`StaticImageData` import via `{...img}` before the carousel picked an
index, then again into `<Image>` leaking blur bookkeeping to the DOM.
Guard the initial render and pass the static import as `src={img}`.
Docs: README Node version bumped 22 -> 24 to match `.nvmrc` / engines,
and CONTRIBUTING clarifies the submodule step is required (not optional)
with the `git submodule update --init` recovery.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis pull request updates documentation (Node.js requirement and git clone instructions), modifies environment configuration for WASM builds, adjusts component prop interfaces, optimizes a loading overlay to prevent re-renders, and removes a development-mode fallback path for WASM locating. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
CONTRIBUTING.md (1)
149-149:⚠️ Potential issue | 🟡 MinorFix typo to unblock the typos CI job.
Pipeline reports
recommededat Line 149; change it torecommended.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@CONTRIBUTING.md` at line 149, Fix the typo "recommeded" to "recommended" in the CONTRIBUTING.md content (the misspelled token "recommeded" at the reported location); update that single word so the typos CI job passes and commit the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@CONTRIBUTING.md`:
- Line 149: Fix the typo "recommeded" to "recommended" in the CONTRIBUTING.md
content (the misspelled token "recommeded" at the reported location); update
that single word so the typos CI job passes and commit the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a84cbfca-b1d0-41f2-b29f-757d6b281b73
📒 Files selected for processing (6)
CONTRIBUTING.mdREADME.mdeditor/.env.exampleeditor/app/(www)/(home)/_home/content-1.tsxeditor/grida-canvas-react-starter-kit/starterkit-loading/loading.tsxeditor/grida-canvas/backends/wasm-locate-file.ts
💤 Files with no reviewable changes (1)
- editor/grida-canvas/backends/wasm-locate-file.ts
Summary
I ran through a fresh-worktree setup of the editor and hit three things that block any contributor's first click after
pnpm install && pnpm dev:editor. Fixing them here, plus the two doc mismatches I tripped on.What changed
/canvasnow boots on a clean cloneeditor/grida-canvas/backends/wasm-locate-file.tshardcodedhttp://localhost:4020/dist/as the dev fallback. That URL is only served byjust serve canvas wasmafterjust build canvas wasm— which pulls emsdk, requires ninja, and takes ~10 min on first run. Result: a fresh checkout's/canvasloaded a progress bar forever with no UI error, no console error, no 404 (I only found the URL viaperformance.getEntriesByType('resource')).Now: in dev, if
NEXT_PUBLIC_GRIDA_WASM_DEV_SERVE_URLis set, use it; otherwise fall through to the unpkg-published wasm (same path prod already uses). Canvas-engine devs who want local wasm still set the env var —.env.examplenow has it commented out and labeled as an opt-in override.Landing page no longer throws on every load
Two separate bugs, both on
/:FullscreenLoadingOverlayingrida-canvas-react-starter-kit/starterkit-loading/loading.tsx:204hadstartTimein the effect's dep array while also being set inside the effect — infinitesetState-in-useEffectloop, showing up asMaximum update depth exceededon every home render. SwitchedstartTimetouseRef; semantics preserved (latch on enter, read on exit).content-1.tsx(the carousel on the home page) spread aStaticImageDataimport via{...img}before the carousel had picked an index, rendering<Image src={undefined} />on first paint (empty-src+ "Image missing required src" warnings), and then leakedblurWidth/blurHeightDOM attrs ("React does not recognize the blurWidth prop" warnings). Guarded the initial render and passsrc={img}so Next owns the blur bookkeeping.Docs
README.md: Node 22+ → 24+ to match.nvmrc(v24.14.0) andengines.node(>=24.0.0).CONTRIBUTING.md: the submodule clone step was labeled "optional" but it's required for any canvas/WASM build (third_party/externals/emsdk). Reworded, added thegit submodule update --initrecovery command for folks who already cloned without--recurse-submodules.Verification
pnpm turbo typecheck --filter=editor→ 28/28 pass (editor rebuilt, not cached).pnpm oxlinton all changed TS → 0 warnings, 0 errors./(no red overlay, 0 errors in console), loaded/canvasand confirmed the wasm fetch URL is nowhttps://unpkg.com/@grida/canvas-wasm@<ver>/dist/grida_canvas_wasm.wasmand the editor UI renders fully without any local rust/emsdk toolchain.Reviewer notes
.envalready setsNEXT_PUBLIC_GRIDA_WASM_DEV_SERVE_URL(the shipped example did). The only change-in-behavior case is a dev who had the var unset — they now get the published wasm in dev instead of a 404./playground/canvasisn't a real route (the Canvas Playground card on/playgroundlinks to/canvas) — no code or docs referenced the phantom path.Test plan
pnpm install && cp editor/.env.example editor/.env && pnpm dev:editor, open/(no red overlay, clean console) and/canvas(editor loads with wasm from unpkg, no local build needed).NEXT_PUBLIC_GRIDA_WASM_DEV_SERVE_URL=http://localhost:4020/distset andjust serve canvas wasmrunning,/canvasstill loads the locally served wasm.Summary by CodeRabbit
Documentation
Bug Fixes
Chores