@needle-tools/engine 5.1.0-alpha.2 → 5.1.0-canary.244f23e

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/dist/{needle-engine.bundle-B-5Q2CpC.min.js → needle-engine.bundle-CJmix0Oo.min.js} +135 -135
  3. package/dist/{needle-engine.bundle-dit3f1l5.js → needle-engine.bundle-CcPGKcD_.js} +5403 -5396
  4. package/dist/{needle-engine.bundle-qZfVf_v-.umd.cjs → needle-engine.bundle-rcR8UYgV.umd.cjs} +135 -135
  5. package/dist/needle-engine.d.ts +16 -17
  6. package/dist/needle-engine.js +188 -186
  7. package/dist/needle-engine.min.js +1 -1
  8. package/dist/needle-engine.umd.cjs +1 -1
  9. package/lib/engine/debug/debug_spatial_console.d.ts +2 -0
  10. package/lib/engine/debug/debug_spatial_console.js +10 -7
  11. package/lib/engine/debug/debug_spatial_console.js.map +1 -1
  12. package/lib/engine/engine_addressables.d.ts +2 -0
  13. package/lib/engine/engine_addressables.js +6 -3
  14. package/lib/engine/engine_addressables.js.map +1 -1
  15. package/lib/engine/engine_gameobject.js +2 -2
  16. package/lib/engine/engine_gameobject.js.map +1 -1
  17. package/lib/engine/engine_init.js +10 -0
  18. package/lib/engine/engine_init.js.map +1 -1
  19. package/lib/engine/engine_scenedata.d.ts +2 -0
  20. package/lib/engine/engine_scenedata.js +2 -0
  21. package/lib/engine/engine_scenedata.js.map +1 -1
  22. package/lib/engine/engine_serialization_builtin_serializer.d.ts +10 -16
  23. package/lib/engine/engine_serialization_builtin_serializer.js +28 -41
  24. package/lib/engine/engine_serialization_builtin_serializer.js.map +1 -1
  25. package/lib/engine-components/AnimatorController.d.ts +2 -0
  26. package/lib/engine-components/AnimatorController.js +4 -1
  27. package/lib/engine-components/AnimatorController.js.map +1 -1
  28. package/lib/engine-components/ReflectionProbe.js +2 -0
  29. package/lib/engine-components/ReflectionProbe.js.map +1 -1
  30. package/lib/engine-components/postprocessing/VolumeParameter.d.ts +2 -0
  31. package/lib/engine-components/postprocessing/VolumeParameter.js +4 -1
  32. package/lib/engine-components/postprocessing/VolumeParameter.js.map +1 -1
  33. package/package.json +2 -2
  34. package/src/engine/debug/debug_spatial_console.ts +10 -7
  35. package/src/engine/engine_addressables.ts +6 -3
  36. package/src/engine/engine_gameobject.ts +2 -2
  37. package/src/engine/engine_init.ts +10 -0
  38. package/src/engine/engine_scenedata.ts +2 -0
  39. package/src/engine/engine_serialization_builtin_serializer.ts +32 -43
  40. package/src/engine-components/AnimatorController.ts +4 -1
  41. package/src/engine-components/ReflectionProbe.ts +2 -0
  42. package/src/engine-components/postprocessing/VolumeParameter.ts +4 -1
package/CHANGELOG.md CHANGED
@@ -5,7 +5,7 @@ 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
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 both local and remote (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.
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
9
  ```ts
10
10
  // fully typed, with autocomplete for every node and component
11
11
  const cam = ctx.sceneData.MyScene.MainCamera.$object; // THREE.PerspectiveCamera
@@ -13,6 +13,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
13
13
  ```
14
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
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
+ ```
16
23
  - **NEW**: `context.lights` array and `context.mainLight` getter for easy access to all scene lights and the primary directional light
17
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:
18
25
  ```js
@@ -54,6 +61,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
54
61
  - Fix: HTML mobile icon not rendering
55
62
  - Fix: UI `Text` component absolute font URL handling
56
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
+
57
73
  ## [5.0.2] - 2026-04-03
58
74
  - Updated `@needle-tools/materialx` to 1.6.0:
59
75
  - UV coordinate convention handling (glTF ↔ OpenGL) — fixes UV-dependent effects like displacement and procedural noise in the browser