fix(webcontainer): prevent double initialization and race conditions when booting WebContainer and loading editor workspace/file tree

This commit is contained in:
2025-12-30 15:47:15 +00:00
parent 26759a5b90
commit c27b532aaa
6 changed files with 63 additions and 9 deletions

View File

@@ -1,5 +1,13 @@
# Changelog
## 2025-12-30 - 3.13.1 - fix(webcontainer)
prevent double initialization and race conditions when booting WebContainer and loading editor workspace/file tree
- Add loadTreeStarted flag in dees-editor-filetree to avoid double-loading the file tree and reset it on refresh or on error to allow retries.
- Add initializationStarted flag in dees-editor-workspace to prevent duplicate workspace initialization and reset it on initialization failure to allow retry.
- Make WebContainerEnvironment use a shared singleton container and a bootPromise so only one WebContainer boot runs per page; instances wait for an ongoing boot instead of booting again.
- Reset bootPromise/sharedContainer on boot failure and clear them on teardown so subsequent attempts can retry cleanly.
## 2025-12-30 - 3.13.0 - feat(editor/runtime)
Replace bare editor with Monaco-based editor and add runtime + workspace/filetree integration