Skip to content

Commit

Permalink
Add out of band loading to rive-wasm
Browse files Browse the repository at this point in the history
Draft, as there's a quite a few bits to do, but would be neat to get thoughts on it

it "works" but there are questions.

- [x] clean up commits a bit
- [x] pull out cdn stuff to pr that alone & unblock @umberto-sonnino
- [x] make prettier example, i think something with a few images is going to work well
- [x] sort out cpp api for decoding assets. dart lets you set the image, i think cpp needs to do the same. (rather than make it implement decode as it currently does)
- [x] asyncify?! ( we are not doing this at this point)
- [x] make fonts replaceable
- [x] fonts do not replace after rendering/ sometimes async fonts do not get drawn (will tackle this later, need to add artboard referencers to assets so that we know what needs to be made dirty once they are updated)
- [x] fix tests
- [x] add tests
- [x] test webgl
- [x] figure out caching (pushed off for later pr)

example looks a bit like this:

https://github.com/rive-app/rive/assets/1216025/98bc1eaf-6076-44d2-93ca-a9cc8ea42f9e

but it can look like this if the fonts do not load properly

![CleanShot 2023-09-26 at 15 52 56](https://github.com/rive-app/rive/assets/1216025/c8e3f06c-2ef4-4e5a-a780-0f764f4d06b3)

(to repro ☝️ set latency to 300ms)

to run.
compile wasm

`cd rive/packages/runtime_wasm/wasm` && `./build_all_wasm.sh`

run the example
`cd rive/packages/runtime_wasm/wasm/examples/out_of_band_example` && `npm start` (oh and `npm install` first)

Diffs=
f95f54140 Add out of band loading to rive-wasm (#6017)
  • Loading branch information
mjtalbot committed Oct 6, 2023
1 parent 9030b8c commit 7e3bcd5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a7e5cc22f727fc5eb6a56ddd1f7ad85b17db2a59
f95f54140657f8b8726392a3d0b4036bb4ad70fb
2 changes: 1 addition & 1 deletion submodules/rive-cpp

0 comments on commit 7e3bcd5

Please sign in to comment.