chore: add Flutter demo embedding to website#840
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
To view this pull requests documentation preview, visit the following URL: Documentation is deployed and generated using docs.page. |
- Add demo registry system with 250+ demo entries - Implement DartPadEmbed, FlutterEmbed, and FlutterMultiView React components - Create build script for Flutter web demos - Add web assets (favicon, icons, manifest) - Add comprehensive E2E tests for embedded demos - Update documentation with demo embedding guide and test pages - Integrate Playwright for visual regression testing
- Add branch naming conventions (Git Flow prefixes) - Add conventional commits format documentation - Symlink CLAUDE.md to AGENTS.md for consistency
93ea5be to
c25934d
Compare
Extract engineRevision from flutter_bootstrap.js instead of flutter.js, matching the new build output format. Fix multiview accessibility test to wait for ready state before asserting visibility.
Align build_runner version across melos.yaml, mix, and mix_generator to the latest release, preventing melos bootstrap from downgrading the constraint.
…d-feature # Conflicts: # melos.yaml
| loadingTimeoutRef.current = null; | ||
| } | ||
| }; | ||
| }, [status, loadingStage, capturedErrors, releaseInitializationLock]); |
There was a problem hiding this comment.
Bug: Loading timeout resets on every stage transition
The useEffect dependency array includes loadingStage and capturedErrors:
}, [status, loadingStage, capturedErrors, releaseInitializationLock]);Since loadingStage changes ~6 times during initialization (through "Waiting for resources...", "Loading Flutter loader script...", etc.), each transition clears the old timeout and starts a fresh 30-second timer. The actual maximum wait before timeout fires is ~6 stages × 30s = ~180s, not the 30 seconds described in the comment on line 210.
These dependencies exist because the timeout callback reads loadingStage and capturedErrors to build its error message. A fix would be to store those values in refs and read from the refs inside the callback, removing them from the dependency array:
const loadingStageRef = useRef(loadingStage);
loadingStageRef.current = loadingStage;
const capturedErrorsRef = useRef(capturedErrors);
capturedErrorsRef.current = capturedErrors;
// Then in the useEffect, use loadingStageRef.current / capturedErrorsRef.current
// and remove loadingStage, capturedErrors from the dependency array
Summary
Consolidates the Flutter demo embedding feature from PR #834 into a single squashed commit.
Test plan
Replaces #834