HomeGuidesAPI ReferenceChangelogDiscussions
Hire a ReactVision Expert 🛠️Launch Studio 🖥️Sponsor on GitHub ❤️Log In
Changelog
fixed

ViroReact 3.2.3: web closes most remaining gaps and a fix for Android minified release builds

Viro on the web closes most of the gaps from the web-vs-native parity review: scene-wide events and ViroController, portals with their own backgrounds, per-face materials, animated images, full particle and physics support, post-process effects, capture on every navigator, and AR plane detection on by default. A .gltf with external files loads instead of aborting the page. On Android, a minified release build no longer crashes at launch in WorkManager's database. The web build needs @reactvision/viro-web-renderer 1.3.0. iOS and Android binaries are unchanged from 3.2.2 apart from one new header setter that only the web build calls.

Web

Everything in this section is web platform support: it is new on the web and already worked on iOS and Android. See the Web Setup Guide.

  • Navigators. project and unproject work on ViroARSceneNavigator, Viro3DSceneNavigator and ViroVRSceneNavigator, and scenes get the navigator as sceneNavigator and, in AR, arSceneNavigator on the ref too. takeScreenshot, startVideoRecording and stopVideoRecording work on all three: saveToCameraRoll downloads the file, and url is an object URL you may revoke. Video carries no audio. recenterTracking is present but does nothing, because there is no headset. ViroVRSceneNavigator renders in mono. Editor scenes' TAKE_PHOTO and RECORD_VIDEO functions use this capture. See ViroARSceneNavigator.
  • Events. Scene-level onClick, onClickState, onHover, onPinch, onRotate and onFuse fire; so do onTransformUpdate and ignoreEventHandling. rotationPivot, scalePivot and highAccuracyEvents work on nodes. ViroController reports scene-wide clicks, pinches, rotates, fuses and drags. A tap on empty space reports position [], as native does. See ViroController and Input Events.
  • Animation. Chains, sequences, parallels and aliases survive registerAnimations. run={false} pauses and run={true} resumes. onFinish fires at the end of every pass, and color and material animate. See Animation.
  • Materials, geometry and media. A model's materials reach it, a materials array applies per face or submesh, and ViroGeometry keeps its submeshes. arShadowReceiver works on ViroQuad and ViroPolygon. Primitive options work: ViroQuad uvCoordinates, ViroSphere segments and facesOutward, ViroPolygon holes and UVs. ViroAnimatedImage animates, images and videos take stereoMode and placeholderSource, ViroSkyBox takes color, and Viro360Image takes isHdr. Media supports seekToTime, onBufferStart, onBufferEnd and onUpdateTime. ViroSound.preloadSounds / unloadSounds, StreamingAudioManager and ViroImage.evictFromCache work. A .gltf with external .bin or image files is fetched and inlined; a missing file fails that model through onError instead of aborting the page.
  • Portals, physics, particles and lights. Each portal gets its own background, and onPortalEnter / onPortalExit fire. Hidden bodies leave the simulation, empty Compound shapes build from the children, applyImpulse with an offset adds torque, velocity is constant, held force and torque work, and findCollisionsWithRayAsync, findCollisionsWithShapeAsync and drawBounds work. Particle emitters take every native prop and update while running. shadowOrthographicPosition places a directional light. See Physics.
  • AR. Plane detection is on by default, as on native (set arOptions.detectPlanes to false to turn it off). Tracking reasons, onTrackingInitialized and onPlatformUpdate fire, anchorDetectionTypes filters planes, and a plane can report classification, vertices and pauseUpdates. onCameraARHitTest works, including on a virtual camera's planes. The camera feed is cropped to fill the screen instead of stretched. See ViroARScene and ViroARPlane.
  • Permissions. checkPermissions and requestRequiredPermissions answer camera, microphone and location. They used to resolve {}, so an app gating AR on result.camera never opened it. storage is always false: the web has no camera roll, and capture downloads the file instead. Asking for the microphone after a ViroSound works on Safari. See Permission helpers.
  • Cameras. ViroOrbitCamera looks at its focal point (its yaw and pitch signs were flipped). Releasing a ViroCamera returns to the default camera. Camera reads and drag work under a perspective camera component in a 3D scene; they still cannot under an orthographic projection or in live AR.
  • Viro Live. The web harness exports the constants, hooks, helpers and every component with a web file, and a stub called outside render warns instead of throwing.
  • Editor scenes on web. StudioSceneNavigator wraps scenes in the native error boundary with retry, so a scene that throws no longer replaces the whole page. MANUAL plane detection mounts the plane selector. Proximity runs without an AR session. See StudioSceneNavigator.

Android

  • A minified release build no longer crashes at launch with Failed to create an instance of class androidx.work.impl.WorkDatabase. Viro uses WorkManager for VPS scan uploads, and WorkManager 2.9.1 brings Room 2.5.0, whose keep rule leaves out the constructor Room calls by reflection to create WorkManager's database. R8 removed it, so the app crashed on start in androidx.startup.InitializationProvider. Viro's consumer rules now keep that constructor, as Room 2.6 does. Expo SDK 58 turns minification on in its Android template, so an app on it with nothing else bringing Room 2.6 or later hit this on its first release build. This can affect any minified Viro Android build, not only VR. See Integrating with Expo.

Check when upgrading

  • Web: install @reactvision/viro-web-renderer 1.3.0. The peer range is now ^1.3.0. Copy its whole wasm/ folder. With 1.2.0 the new features stay off and a one-time warning names what is missing.
  • Web: plane detection is on by default, as on native. If you relied on web AR starting with no planes unless you set arOptions.detectPlanes, set it to false.
  • Android on Expo SDK 58: build a minified release APK and open it on a device before you ship. This release removes the WorkManager crash an R8 build hit at launch.

See Upgrading to 3.2.0 for the upgrade notes, and the GitHub release.