chore(examples): migrate to async API, add no-deprecated lint rule#194
Merged
chore(examples): migrate to async API, add no-deprecated lint rule#194
Conversation
Adds an explicit test for the contract that `useRiveNumber` delivers its initial value purely from the first listener emission on subscribe — no prop change is required. Uses a tight 1 s timeout to make it fail fast if the hook ever accidentally regresses to relying on a prop update cycle.
Mirror of the existing Data Binding exerciser but with WithViewModelSetup replaced to use `defaultArtboardViewModelAsync()` and `createDefaultInstanceAsync()` instead of the deprecated sync counterparts. Useful for verifying the async path produces identical visual results.
7ba48ca to
d4d6195
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates all example/demo/exerciser files off the deprecated sync ViewModel API and enables
@typescript-eslint/no-deprecatedas a lint error to prevent regressions.Examples migrated (sync
useMemochains →useViewModelInstancehook oruseEffect+async):RiveDataBindingExample,DataBindingArtboardsExample,FontFallbackExample,NestedViewModelExample— now useuseViewModelInstance(file)ManyViewModels—useEffect+defaultArtboardViewModelAsync/createInstanceByNameAsyncMenuListExample—viewModelByNameAsync,createBlankInstanceAsync,prop.set()instead ofprop.value =QuickStart—prop.value = 9write →prop.set(9)New exerciser:
RiveDataBindingExampleExpApi— same asData Bindingbut explicitly uses raw async calls (defaultArtboardViewModelAsync/createDefaultInstanceAsync) for comparison.Lint rule:
@typescript-eslint/no-deprecated: errorscoped tosrc/**andexample/src/**. Intentionally deprecated showcases (Events, SM inputs, Text runs) and library hooks pending async migration geteslint-disablewith TODO comments.Harness test: asserts that
useRiveNumberdelivers its initial value on first listener emission without requiring any prop update.