Skip to content

feat(rive-angular): add dual runtime support with webgl2 fallback#1

Closed
andrei-shpileuski wants to merge 12 commits into
mainfrom
feat/webgl2
Closed

feat(rive-angular): add dual runtime support with webgl2 fallback#1
andrei-shpileuski wants to merge 12 commits into
mainfrom
feat/webgl2

Conversation

@andrei-shpileuski
Copy link
Copy Markdown
Contributor

@andrei-shpileuski andrei-shpileuski commented Apr 19, 2026

Introduce configurable canvas/webgl2 runtime loading with optional strict mode and automatic fallback to improve compatibility while enabling advanced rendering features.


Note

Medium Risk
Changes core runtime initialization and Rive instance creation to dynamically select between @rive-app/canvas and @rive-app/webgl2, which could affect loading behavior and error handling across the library. Backward compatibility paths (canvas default, selector aliasing, fallback/strict modes) reduce risk but add complexity.

Overview
Adds dual runtime support so provideRiveRuntime() can choose renderer: 'canvas' | 'webgl2' with optional strict mode; when non-strict, runtime init (and component instantiation) can automatically fall back to the alternate renderer on failure.

Updates RiveCanvasComponent and RiveFileService to construct Rive/RiveFile from the resolved SDK module via a new rive-sdk facade, and exposes <rive> as the preferred selector while keeping <rive-canvas> as a legacy alias.

Bumps @grandgular/rive-angular to 1.2.0-beta.0, adds optional peer dependency @rive-app/webgl2, and expands docs/changelog plus new runtime tests covering renderer selection and fallback behavior.

Reviewed by Cursor Bugbot for commit 604d969. Bugbot is set up for automated code reviews on this repo. Configure here.

Introduce configurable canvas/webgl2 runtime loading with optional strict mode and automatic fallback to improve compatibility while enabling advanced rendering features.
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 19, 2026

You have used all of your free Bugbot PR reviews.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

…nly Rive exports

- Load canvas/webgl2 SDKs via dynamic import; centralize missing-module and
  fallback errors with actionable messages
- Default resolved runtime config when provideRiveRuntime is absent; unify
  component and file service initialization
- Replace static re-exports from @rive-app/canvas with local enums/types;
  export Rive/RiveFile/Layout/StateMachineInput/ViewModelInstance as types only
- Optional peerDependenciesMeta for both Rive runtimes; README install matrix
- Bump package to 2.0.0-beta.0; changelog for v2; remove unreleased 1.2.0-beta.0
  section; stabilize zoneless specs and reset runtime state in tests
…ndled

- Use await Promise.resolve(file.init()) and keep failed state in catch
- RiveFile.init typing: void | Promise<void>
- Stabilize init-failure specs with async flushLoadMicrotasks
- Bump package version; document RiveFile.init await fix in changelog
- Update README pre-release tag
Restores consumer typing for direct Rive instance usage after v2 stub Rive
interface replaced canvas re-exports.
- Bump version; changelog entry for Rive event API typing fix
- Update README pre-release tag
Vite must not require absent optional peers at analyze time for canvas-only
or webgl2-only installs.

chore(release): 2.0.0-beta.3
@andrei-shpileuski andrei-shpileuski deleted the feat/webgl2 branch April 27, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant