fix(dev): preserve editor state across runtime HMR
Summary: Imported in-root Vite modules that belong to the runtime module graph could fall through to the full-reload path, reloading the managed editor and losing its active scene state. The automated example launcher also used the headed workspace mode, which cannot reach browser command readiness in the Linux test environment.
Route matching project modules only to runtime clients, retain optional websocket fallbacks for lightweight test contexts, and cover both JavaScript and imported JSON updates with managed-browser end-to-end tests. Launch matrix servers in agent mode and add the required patch changeset.
GitHub issue addressed:
- https://github.com/facebook/immersive-web-sdk/issues/48 — code changes trigger a full managed-browser reload while Scene Editor is active, losing the current scene session.
Reviewed By: cabanier
Differential Revision: D119226473
fbshipit-source-id: bee3c50d51ffebf4f14bd5f4042b553062331782
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Immersive Web SDK
Where every webpage can become a world.
The Immersive Web SDK makes building immersive web experiences as approachable as traditional web development. It’s a complete collection of frameworks and tools built on Three.js with a high-performance Entity Component System, developer-first workflow with one-command setup and built-in emulation, and production-ready systems for grab interactions, locomotion, spatial audio, physics, and scene understanding.
Same code, two experiences: Run immersively in VR/AR headsets and automatically provide mouse-and-keyboard emulation on desktop browsers. No browser extensions, no special setup—anyone with a laptop can develop for the immersive web.
Getting Started
Create a new project with a single command:
Or install into an existing project:
Keep the exact
threealias at the application root and override transitive resolutions so the app and IWSDK share one runtime:Documentation
For guides, concepts, and API reference, visit: https://iwsdk.dev
Packages
Development
bootstrapis also the repair command for a partial or stale source build. It uses the lockfile, builds packages in dependency order, and generates WebXR input profiles from the pinned npm asset package instead of making a separate CDN request. Runcorepack pnpm@10.18.3 run doctorfor environment, proxy, and generated-output checks.For a network-restricted checkout whose pnpm store is already warm, use
corepack pnpm@10.18.3 run bootstrap:offline. Initial dependency installation still needs registry access (and honors standard npm/pnpm proxy configuration), but subsequent profile generation and builds are offline-safe. A directory-linked@iwsdk/clinow keeps a stable launcher; if itsdistis missing, it prints the exact package build command instead of leaving a broken executable link.Development Workflow
The examples use
file:dependencies pointing to.tgzfiles built from local packages. This simulates how end-users will consume the packages from npm.npm run build:tgz- Builds all packages in dependency order and creates.tgzarchivesnpm run fresh:dev(in example) - Cleansnode_modules, reinstalls from tgz files, and starts dev serverThis ensures examples always test against the latest local build.
License
IWSDK is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please review our Contributing Guidelines and Code of Conduct before submitting issues or pull requests.
Developer Terms