mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-05-21 23:36:36 +08:00

I started adding Text features to rive_core and realized that the dependency structure is going to be very difficult to manage here. Here's why: ## rive_core - has most of the runtime logic for things like IK, mesh, shapes, etc ## rive_flutter - depends on rive_core (not directly but we transpile rive_core to rive_flutter) - also includes the FFI/WASM text runtime The problem is that rive_core needs the FFI/WASM text runtime. So we have a cyclic dependency. We've dealt with something similar (not quite as extreme) by abstracting things like nested artboards, but it gets very complex for a verbose API like the text one. ## rive_common What this PR does is reworks a lot of shared logic like Math (Vec2D, Mat2D, etc), low-level text runtime (FFI/WASM), etc into a "rive_common" package. We've had shared packages before but none that have been shared by rive_flutter and rive_editor. I think it's finally time to bite the bullet here. This will make it much easier to work through some of the obtuse abstraction patterns we've had to do to disambiguate if you're using a Vec2D from the runtime or the editor, for example. Yes, this means we'll only have one set of math classes, one set of binary writer/readers, etc. I only did the bare minimum necessary to move text into rive_common in this first pass but we can do more as we go forward. ## TODO: - [x] move Text WASM & FFI to rive_common - [x] move Math used by text (Mat2D, Vec2D, TransformComponents, PathInterface, etc) to rive_common - [x] move utilities used by text (binary reader/writer) to rive_common - [x] fix core_generator and core_generator_runtime - [x] fix github actions to use new paths - [x] publish rive_common to pub.dev and unlist it Diffs= 12c6ee130 rive_common package (#4434) 5a24e63d0 Initialize isClosed on TessRenderPath (#4431)
2 lines
40 B
Dart
2 lines
40 B
Dart
export 'package:rive_common/math.dart';
|