@sceneview-sdk/react-native 4.17.0 → 4.19.0

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.
@@ -3,6 +3,7 @@ package io.github.sceneview.reactnative
3
3
  import android.widget.FrameLayout
4
4
  import androidx.compose.foundation.layout.fillMaxSize
5
5
  import androidx.compose.runtime.DisposableEffect
6
+ import androidx.compose.runtime.key
6
7
  import androidx.compose.runtime.mutableStateListOf
7
8
  import androidx.compose.runtime.mutableStateOf
8
9
  import androidx.compose.runtime.remember
@@ -109,10 +110,25 @@ class SceneViewManager : SimpleViewManager<FrameLayout>() {
109
110
  position = Position(y = 0f, z = 3.0f)
110
111
  }
111
112
 
112
- val environment = state.environmentPath.value?.let { path ->
113
+ // Single, stable environment call site (issue #2365): compute exactly one
114
+ // non-null Environment rather than branching between a keyed HDR call and a
115
+ // separate `environment ?: rememberEnvironment(...)` fallback at the SceneView
116
+ // argument. The `path` is the remember key, so:
117
+ // - null path → the default neutral environment;
118
+ // - path A → path B → the Environment is rebuilt (skybox/IBL actually
119
+ // swaps; the stale-factory bug of #2361).
120
+ // Uses Compose key {} rather than rememberEnvironment's own key= param because
121
+ // this bridge compiles against the published Maven artifact (sceneview:4.7.0)
122
+ // that predates key=. key {} replaces the group on a new path, disposing the old
123
+ // Environment via its DisposableEffect.
124
+ // TODO(#2361): migrate to rememberEnvironment(..., key = path) once this bridge
125
+ // consumes a SceneView release that includes the public key= param.
126
+ val environmentPath = state.environmentPath.value
127
+ val environment = key(environmentPath) {
113
128
  rememberEnvironment(environmentLoader) {
114
- environmentLoader.createHDREnvironment(path)
115
- ?: io.github.sceneview.createEnvironment(environmentLoader)
129
+ environmentPath?.let { path ->
130
+ environmentLoader.createHDREnvironment(path)
131
+ } ?: io.github.sceneview.createEnvironment(environmentLoader)
116
132
  }
117
133
  }
118
134
 
@@ -123,7 +139,7 @@ class SceneViewManager : SimpleViewManager<FrameLayout>() {
123
139
  modelLoader = modelLoader,
124
140
  materialLoader = materialLoader,
125
141
  cameraNode = cameraNode,
126
- environment = environment ?: rememberEnvironment(environmentLoader),
142
+ environment = environment,
127
143
  onGestureListener = gestureListener,
128
144
  ) {
129
145
  state.modelPaths.forEach { model ->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sceneview-sdk/react-native",
3
- "version": "4.17.0",
3
+ "version": "4.19.0",
4
4
  "description": "React Native bindings for SceneView — 3D and AR scenes powered by Filament (Android) and RealityKit (iOS)",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -70,7 +70,10 @@
70
70
  ]
71
71
  },
72
72
  "overrides": {
73
- "fast-xml-parser": "^5.7.0"
73
+ "fast-xml-parser": "^5.7.0",
74
+ "@babel/core": "^7.29.6",
75
+ "shell-quote": "^1.8.4",
76
+ "js-yaml": "^3.15.0"
74
77
  },
75
78
  "react-native-builder-bob": {
76
79
  "source": "src",