@volter/editor-game 0.5.125 → 0.5.126

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@volter/editor-game",
3
3
  "author": "Volter AI, Inc.",
4
4
  "license": "AGPL-3.0-only",
5
- "version": "0.5.125",
5
+ "version": "0.5.126",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -101,11 +101,11 @@
101
101
  "serving": "./dist-node/serving.mjs"
102
102
  },
103
103
  "dependencies": {
104
- "@volter/editor-sdk": "0.5.125",
105
- "@volter/editor-project": "0.5.125",
106
- "@volter/editor-threejs": "0.5.125",
107
- "@volter/threejs-runtime": "0.5.125",
108
- "@volter/game-runtime": "0.5.125",
104
+ "@volter/editor-sdk": "0.5.126",
105
+ "@volter/editor-project": "0.5.126",
106
+ "@volter/editor-threejs": "0.5.126",
107
+ "@volter/threejs-runtime": "0.5.126",
108
+ "@volter/game-runtime": "0.5.126",
109
109
  "@colyseus/msgpackr": "^1.11.3",
110
110
  "@colyseus/schema": "^4.0.14",
111
111
  "@colyseus/sdk": "^0.17.34",
@@ -120,6 +120,7 @@
120
120
  "draco3d": "^1.5.7",
121
121
  "esbuild-wasm": "0.25.12",
122
122
  "fastnoise-lite": "^1.1.1",
123
+ "its-fine": "^2.1.1",
123
124
  "loglayer": "^9.1.0",
124
125
  "mediabunny": "1.56.2",
125
126
  "meshoptimizer": "^1.2.0",
@@ -138,7 +139,7 @@
138
139
  "xstate": "^5.32.4",
139
140
  "zod": "^4.3.6",
140
141
  "@fortawesome/fontawesome-svg-core": "^7.2.0",
141
- "@volter/editor-react": "0.5.125"
142
+ "@volter/editor-react": "0.5.126"
142
143
  },
143
144
  "peerDependencies": {
144
145
  "@sparkjsdev/spark": "^2.1.0",
@@ -20,10 +20,12 @@ import type { RootAdapter, ThreeHostContext } from '@volter/editor-project/adapt
20
20
  import { R3F_RUNTIME_PATH } from '@volter/editor-sdk/host';
21
21
  import { isPackagedRuntime } from '@volter/editor-sdk/kit/packaged-runtime';
22
22
  import { Component, createElement, Fragment, useEffect } from 'react';
23
+ import { FiberProvider } from 'its-fine';
23
24
  import type * as THREE from 'three';
24
25
  import { type R3FRuntime, resolveR3FEntryAdapter } from './roots/r3f-root';
25
26
 
26
27
  const CHECKOUT_RUNTIME: R3FRuntime = {
28
+ FiberProvider,
27
29
  createElement,
28
30
  Fragment,
29
31
  Component,
@@ -43,6 +45,7 @@ interface PackagedR3FRuntime {
43
45
  let cachedPackagedRuntime: Promise<PackagedR3FRuntime> | null = null;
44
46
 
45
47
  const RUNTIME_MEMBERS = [
48
+ 'FiberProvider',
46
49
  'createElement',
47
50
  'Fragment',
48
51
  'Component',
@@ -66,6 +69,7 @@ async function packagedRuntime(): Promise<PackagedR3FRuntime> {
66
69
  }
67
70
  return {
68
71
  runtime: {
72
+ FiberProvider: mod['FiberProvider'] as R3FRuntime['FiberProvider'],
69
73
  createElement: mod['createElement'] as R3FRuntime['createElement'],
70
74
  Fragment: mod['Fragment'] as R3FRuntime['Fragment'],
71
75
  Component: mod['Component'] as R3FRuntime['Component'],
@@ -49,6 +49,7 @@ import type { ComponentType, PropsWithChildren } from 'react';
49
49
 
50
50
  /** The React and Fiber a three world is mounted with — the ones its own hooks resolve. */
51
51
  export interface R3FRuntime {
52
+ readonly FiberProvider: typeof import('its-fine').FiberProvider;
52
53
  readonly createElement: typeof React.createElement;
53
54
  readonly Fragment: typeof React.Fragment;
54
55
  readonly Component: typeof React.Component;
@@ -204,11 +205,17 @@ function threeWorldAdapter(id: string, component: ComponentType, runtime: R3FRun
204
205
  // No `<StrictMode>` — the host mounts once; StrictMode's deliberate
205
206
  // double-invoke of effects would double-subscribe `useFrame` callbacks
206
207
  // against a host loop that only ticks once per frame.
208
+ // Canvas normally supplies FiberProvider. A raw createRoot needs it
209
+ // too, so authored context bridges can carry R3F contexts into DOM.
207
210
  const world = createElement(
208
- Fragment,
211
+ runtime.FiberProvider,
209
212
  null,
210
- content,
211
- createElement(MountEffectsReady, { key: 'volter-mount-effects-ready' }),
213
+ createElement(
214
+ Fragment,
215
+ null,
216
+ content,
217
+ createElement(MountEffectsReady, { key: 'volter-mount-effects-ready' }),
218
+ ),
212
219
  );
213
220
  // A reconcile-time crash (e.g. a missing `extend` catalogue entry)
214
221
  // surfaces as an uncaught window error and `onCreated` never fires —