Repository navigation
allow setting custom root element in flutter - #1065
Conversation
✅ Deploy Preview for livecodes ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Deploying livecodes with
|
| Latest commit: |
261e3dd
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://143d33a4.livecodes.pages.dev |
| Branch Preview URL: | https://flutter.livecodes.pages.dev |
|
|
Size Change: 0 B Total Size: 1.26 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Custom Flutter root element —
lang-dart-runtime.tsnow resolves a container for the Flutter engine (#livecodes-appfrom the HTML tab when present, else an injected full-page<div>) and passes it toDartWasm.loadRuntime, and defers runtime loading to firstrunso the container resolves afterdocument.body/markup exist. @live-codes/dart-wasm0.7.0 —vendors.tsbumps the CDN base URL to the release whoseloadRuntimeacceptscontainer.- Docs — new "Root Element" section plus an inline demo with a sized
#livecodes-appelement influtter.mdx.
I confirmed @live-codes/dart-wasm@0.7.0 is published and that loadRuntime supports container (Flutter embeds into the given element; with no container it defaults to document.body, which is why the previous eager load at head-parse time — when document.body is still null — fell back to the engine's own full-page host). The injected position: fixed; inset: 0 container reproduces that viewport-filling behavior, #livecodes-app matches the convention used by the react/vue/svelte/elm runtimes, and the lazy ready() is safe because the result page is a fresh document per run.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe Dart runtime now initializes on the first run. Flutter receives an existing ChangesFlutter runtime initialization
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant run
participant flutterContainer
participant DOM
participant loadRuntime
run->>flutterContainer: Select or create Flutter render container
flutterContainer->>DOM: Find #livecodes-app or append full-page div
run->>loadRuntime: Initialize runtime with Flutter container on first run
Merge Risk: ⚪ Minimal · up to The initialization retry limitation predates this change, and the custom Flutter render target is supported. No new merge-blocking issue is identified. Pre-merge checks |
|




Summary by CodeRabbit
New Features
livecodes-appelement. If one isn’t present, the app creates a full-page drawing area automatically.Documentation