目录
Felix Zhang

fix: trim unused Lucide icons, add Meta VR Glasses test skill, fix XR layers on Quest Browser

Summary: 1.1.0 launch fixes, verified on 10 leased Quest 3S headsets (Quest Browser 154.2 and 156).

Lucide icons in production bundles. Since 1.0, drawcall/uikitml‘s kit module built its Lucide component set from import * as Lucide, so every app shipped all 1,594 icons. iwsdk/vite-plugin-dev now rewrites that module in vite build to import only the icons named in static public/**/*.uikitml (plus Horizon’s own Check/ChevronDown). The new iwsdkDev({ bundle: { icons: [...] | 'all' } }) keeps icons for UIKitML built or fetched at runtime, and suggests the PascalCase name for typos. In a trimmed build, iwsdk/core turns a UIKitML “Unknown component” error into a hint naming that option. Dev server and editor keep every icon. Starter dist/ goes from 7.6 MB to 3.6 MB (main chunk 6,663 kB / 1,707 kB gzip to 2,434 kB / 671 kB).

Meta VR Glasses test skill. New apps get iwsdk-glasses-test (Claude and portable .agents copies): the metaVRGlasses emulator profile, a field-of-view check against the glasses’ 37°/25°/43° view (corrected view-axis formula, corner method), gaze + pinch and fallback testing from the CLI, gaze console diagnostics, and both Quest modes (target-device preview with pairing, and --native-xr-control). It was validated by an agent following it literally in the emulator and on a headset. AGENTS.md routes glasses/gaze work and Quest device testing to their skills; the UI skill and UIKitML rule now explain icon trimming. .gitignore no longer ignores the canonical packages/create/guidance/claude/.claude/ tree (existing skills there were tracked only by force-add).

XR layers on Quest Browser.

  • Entering XR with a quad or cylinder layer hung: the 4x multisampled layer targets resolved depth by default, so three.js disabled multisampled-render-to-texture when the session supplied the textures and bound a framebuffer that was never created (Invalid value used as weak map key on the first XR frame). Layer targets no longer resolve depth.
  • XRQuadLayer width/height are half-extents in Quest Browser and the IWER polyfill; passing full dimensions (since 2c7b66c68d9) drew quads at twice their size.
  • The punch-through mesh showed every transparent layer texel as a black box; content layers composite over the projection layer, so the mesh is now kept for visibility/raycasts but not drawn.
  • The 2D fallback showed quad content upside down and cylinder content mirrored.

Gaze diagnostics. Emulated gaze (desktop IWER, native override) no longer claims “real gaze data” or warns about a head-locked runtime, and a mid-session gaze disconnect no longer also logs “never appeared”.

Reviewed By: cabanier

Differential Revision: D126974237

fbshipit-source-id: a57296b666f09b8f8d629c715ac81ef5eb5ff2b1

6天前286次提交

Immersive Web SDK

npm version npm download language license

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:

npm create @iwsdk@latest

Or install into an existing project:

npm install @iwsdk/core three@npm:super-three@0.185.0

Keep the exact three alias at the application root and override transitive resolutions so the app and IWSDK share one runtime. npm reads the override from package.json:

{
  "dependencies": {
    "@iwsdk/core": "^1.0.0",
    "three": "npm:super-three@0.185.0"
  },
  "overrides": {
    "three": "npm:super-three@0.185.0"
  }
}

pnpm 10 and 11 read root overrides from pnpm-workspace.yaml:

packages:
  - '.'
overrides:
  three: npm:super-three@0.185.0

Documentation

For guides, concepts, and API reference, visit: https://iwsdk.dev

Packages

Package Description
@iwsdk/core Core SDK with ECS, systems, and WebXR integration
@iwsdk/create CLI for scaffolding new projects
@iwsdk/locomotor Locomotion engine for Three.js WebXR
@iwsdk/xr-input WebXR input system for Three.js
@iwsdk/vite-plugin-dev XR emulation, AI agent tooling, and dev browser

Development

# Use the pinned Node major, install dependencies, and build runtime/tooling packages
nvm use
corepack pnpm@10.18.3 run bootstrap

# Build every workspace package, including the generated reference corpus
corepack pnpm@10.18.3 run build:all

# Build all packages as tgz files (for examples to consume)
npm run build:tgz

# Type-check every example as a fresh consumer of locally built tgz packages
corepack pnpm@10.18.3 run typecheck:examples

# Run an example (fresh install from local tgz packages)
cd examples/locomotion && npm run fresh:dev

# Lint and format
corepack pnpm@10.18.3 run lint
corepack pnpm@10.18.3 run format

# Build a specific package
corepack pnpm@10.18.3 --filter @iwsdk/core build

bootstrap is also the repair command for a partial or stale source build. It uses the lockfile, builds runtime and tooling packages in dependency order, and generates WebXR input profiles from the pinned npm asset package instead of making a separate CDN request. It deliberately leaves out the producer-only @iwsdk/reference-assets package. build:all includes that package by running its full ingest pipeline, which downloads the pinned embedding model on a fresh machine. Run corepack pnpm@10.18.3 run doctor for 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/cli now keeps a stable launcher; if its dist is missing, it prints the exact package build command instead of leaving a broken executable link.

Development Workflow

The examples use file: dependencies pointing to .tgz files built from local packages. This simulates how end-users will consume the packages from npm.

  1. npm run build:tgz - Builds all packages in dependency order and creates .tgz archives
  2. npm run fresh:dev (in example) - Cleans node_modules, reinstalls from tgz files, and starts dev server

This ensures examples always test against the latest local build. typecheck:examples applies the same boundary to every TypeScript example: it rebuilds development tarballs, removes each example’s ignored install state, installs from those tarballs, and invokes that example’s local TypeScript binary.

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

    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号