@needle-tools/engine 5.1.0-canary.e814457 → 5.1.0-canary.fbdfce3
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/.needle/generated/needle-bindings.gen.d.ts +5 -0
- package/CHANGELOG.md +34 -0
- package/components.needle.json +1 -1
- package/dist/{needle-engine.bundle-LwCwfdUu.js → needle-engine.bundle-BFSj2Fz8.js} +7637 -7672
- package/dist/{needle-engine.bundle-CHd9wkm7.min.js → needle-engine.bundle-CmxIO5uH.min.js} +141 -141
- package/dist/{needle-engine.bundle-Gd4MZdAY.umd.cjs → needle-engine.bundle-tJIZukCz.umd.cjs} +141 -141
- package/dist/needle-engine.d.ts +35 -62
- package/dist/needle-engine.js +188 -186
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/three-examples.js +3778 -4289
- package/dist/three-examples.min.js +14 -301
- package/dist/three-examples.umd.cjs +14 -301
- package/lib/engine/debug/debug_spatial_console.d.ts +2 -0
- package/lib/engine/debug/debug_spatial_console.js +10 -7
- package/lib/engine/debug/debug_spatial_console.js.map +1 -1
- package/lib/engine/engine_addressables.d.ts +2 -0
- package/lib/engine/engine_addressables.js +6 -3
- package/lib/engine/engine_addressables.js.map +1 -1
- package/lib/engine/engine_context.d.ts +16 -19
- package/lib/engine/engine_context.js +12 -15
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_init.js +10 -0
- package/lib/engine/engine_init.js.map +1 -1
- package/lib/engine/engine_scenedata.d.ts +5 -7
- package/lib/engine/engine_scenedata.js +14 -11
- package/lib/engine/engine_scenedata.js.map +1 -1
- package/lib/engine/engine_serialization_builtin_serializer.d.ts +10 -16
- package/lib/engine/engine_serialization_builtin_serializer.js +28 -41
- package/lib/engine/engine_serialization_builtin_serializer.js.map +1 -1
- package/lib/engine/webcomponents/jsx.d.ts +51 -0
- package/lib/engine/webcomponents/logo-element.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu.d.ts +2 -3
- package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
- package/lib/engine/webcomponents/needle-button.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine-components/AnimatorController.d.ts +2 -0
- package/lib/engine-components/AnimatorController.js +4 -1
- package/lib/engine-components/AnimatorController.js.map +1 -1
- package/lib/engine-components/Light.d.ts +0 -19
- package/lib/engine-components/Light.js +4 -96
- package/lib/engine-components/Light.js.map +1 -1
- package/lib/engine-components/ReflectionProbe.js +2 -0
- package/lib/engine-components/ReflectionProbe.js.map +1 -1
- package/lib/engine-components/postprocessing/VolumeParameter.d.ts +2 -0
- package/lib/engine-components/postprocessing/VolumeParameter.js +4 -1
- package/lib/engine-components/postprocessing/VolumeParameter.js.map +1 -1
- package/lib/needle-engine.d.ts +2 -0
- package/lib/needle-engine.js +1 -0
- package/lib/needle-engine.js.map +1 -1
- package/package.json +2 -1
- package/plugins/dts-generator/dts.codegen.js +13 -7
- package/plugins/dts-generator/dts.writer.js +1 -1
- package/plugins/dts-generator/glb.extractor.js +12 -1
- package/plugins/dts-generator/glb.reader.js +47 -29
- package/plugins/types/userconfig.d.ts +12 -0
- package/plugins/vite/dts-generator.d.ts +2 -2
- package/plugins/vite/dts-generator.js +6 -1
- package/plugins/vite/reload.js +18 -17
- package/src/engine/debug/debug_spatial_console.ts +10 -7
- package/src/engine/engine_addressables.ts +6 -3
- package/src/engine/engine_context.ts +18 -20
- package/src/engine/engine_init.ts +10 -0
- package/src/engine/engine_scenedata.ts +13 -10
- package/src/engine/engine_serialization_builtin_serializer.ts +32 -43
- package/src/engine/webcomponents/jsx.d.ts +51 -0
- package/src/engine/webcomponents/logo-element.ts +1 -0
- package/src/engine/webcomponents/needle menu/needle-menu.ts +2 -1
- package/src/engine/webcomponents/needle-button.ts +1 -0
- package/src/engine/webcomponents/needle-engine.ts +1 -0
- package/src/engine-components/AnimatorController.ts +4 -1
- package/src/engine-components/Light.ts +4 -95
- package/src/engine-components/ReflectionProbe.ts +2 -0
- package/src/engine-components/postprocessing/VolumeParameter.ts +4 -1
- package/src/needle-engine.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,31 @@ All notable changes to this package will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [5.1.0-alpha.2] - 2026-04-13
|
|
8
|
+
- **NEW**: Scene Bindings (experimental) — auto-generated TypeScript types from your glTF scenes, providing typed access to nodes, components, and properties via `ctx.sceneData` or `needle.sceneData`. Types are generated automatically by a Vite plugin whenever your scene files change — no configuration needed. Works with any glTF/GLB assigned as `src` on `<needle-engine>`, including remote URLs and Needle Cloud assets. The API shape (particularly `$components` and `$object` accessors) may evolve based on feedback. Can be disabled with `dts: { enabled: false }` in your Vite plugin config.
|
|
9
|
+
```ts
|
|
10
|
+
// fully typed, with autocomplete for every node and component
|
|
11
|
+
const cam = ctx.sceneData.MyScene.MainCamera.$object; // THREE.PerspectiveCamera
|
|
12
|
+
const orbit = ctx.sceneData.MyScene.MainCamera.$components.OrbitControls; // typed!
|
|
13
|
+
```
|
|
14
|
+
- **NEW**: SSR support (experimental) — import Needle Engine in Node.js/SSR frameworks (SvelteKit, Next.js, Nuxt) without `ReferenceError` crashes. The engine now provides SSR-safe base classes and skips browser-dependent initialization on the server. Core rendering still happens client-side — SSR support means your app can import and reference engine code server-side without errors.
|
|
15
|
+
- **NEW**: JSX type declarations for `<needle-engine>` and other web components — first-class support for React, Preact, SolidJS, and other JSX-based frameworks with full autocomplete and type checking
|
|
16
|
+
- **NEW**: `needle` shorthand (experimental) — quick access to the current engine context from anywhere without passing `ctx` around. Works in React/Svelte/Vue components, button handlers, or plain JavaScript. SSR-safe.
|
|
17
|
+
```ts
|
|
18
|
+
import { needle } from "@needle-tools/engine";
|
|
19
|
+
needle.scene.traverse(obj => { ... }); // access the three.js scene
|
|
20
|
+
needle.renderer; // access the WebGLRenderer
|
|
21
|
+
needle.sceneData.MyScene.Camera.$components.OrbitControls.autoRotate = true;
|
|
22
|
+
```
|
|
23
|
+
- **NEW**: `context.lights` array and `context.mainLight` getter for easy access to all scene lights and the primary directional light
|
|
24
|
+
- Add: `needlePlugins()` can now be called without arguments — the Vite command is resolved automatically. This simplifies setup in frameworks like SvelteKit where `defineConfig` doesn't expose the command:
|
|
25
|
+
```js
|
|
26
|
+
export default defineConfig({ plugins: [sveltekit(), needlePlugins()] });
|
|
27
|
+
```
|
|
28
|
+
- Fix: BloomEffect and Sharpening were pulling in the entire `postprocessing` library even in projects that don't use postprocessing, increasing bundle size unnecessarily
|
|
29
|
+
- Fix: SceneSwitcher now shows the object name in the URL when referencing scene objects (instead of just an index)
|
|
30
|
+
- Improved: Vite plugin reliability (fewer unnecessary reloads, cleaner log output)
|
|
31
|
+
|
|
7
32
|
## [5.1.0-alpha.1] - 2026-04-10
|
|
8
33
|
- Add: `AnimatorControllerBuilder` for building animator controllers from code (experimental)
|
|
9
34
|
- Add: XR global events now return an unsubscribe function + `onBeforeXRSessionRequest` event
|
|
@@ -36,6 +61,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
36
61
|
- Fix: HTML mobile icon not rendering
|
|
37
62
|
- Fix: UI `Text` component absolute font URL handling
|
|
38
63
|
|
|
64
|
+
## [5.0.4] - 2026-04-20
|
|
65
|
+
- Fix: VideoPlayer not working when tree-shaking is enabled due to URL serializer being removed
|
|
66
|
+
- Fix: ReflectionProbe not cleaning up `envMapRotation` and `envMapIntensity` overrides when removing envMap
|
|
67
|
+
|
|
68
|
+
## [5.0.3] - 2026-04-08
|
|
69
|
+
- Add: PMREM / FastHDR support for GroundProjection with shader-based blurriness, blending, and alpha controls
|
|
70
|
+
- Fix: MaterialPropertyBlock multi-material change from opaque to transparent
|
|
71
|
+
- Improved: OrbitControls JSDoc for `targetBounds`
|
|
72
|
+
|
|
39
73
|
## [5.0.2] - 2026-04-03
|
|
40
74
|
- Updated `@needle-tools/materialx` to 1.6.0:
|
|
41
75
|
- UV coordinate convention handling (glTF ↔ OpenGL) — fixes UV-dependent effects like displacement and procedural noise in the browser
|