-
Notifications
You must be signed in to change notification settings - Fork 186
add react-strict-animated library #399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
workflow: benchmarks/sizeComparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.
|
workflow: benchmarks/perf (native)Comparison of performance test results, measured in operations per second. Larger is better.
|
|
Thanks for bringing the animation library you've made to the OSS project! Want a hand with the build and package parts? |
a998fec to
cd4733c
Compare
So I recreated the build system that's basically exactly like how RSD is built but I'm running into some issues related to the
|
|
I've tried digging into how to resolve the type generation issues but haven't had any luck yet :/ |
|
We can try upgrading the translator package. And if that doesn't work, report the issues to the flow team |
Note: still working on the build/package structure so not quite ready for review yet This introduces a new package to the RSD repo that provides a subset of React Native's API that works on both web and native, and built with integration of react-strict-dom in mind. The native implementation is largely a thin passthrough to the proper Animated API and some settings pre-configured (such as `useAnimatedDriver` always being enabled). The web side is a new Animated implementation that ends up being driven by the Web Animations API.
|
Okay I updated the flow-api-translator which didn't seem to do much but I did find a way to reorganize the exports so that there were no more flow errors after building. |
necolas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any ideas on how we might have some unit test coverage for the library?
We could also add a couple of e2e examples in the platform-tests app
| let normalizedColor = normalizeColor(input); | ||
|
|
||
| if (normalizedColor != null && typeof normalizedColor === 'object') { | ||
| throw new Error('PlatformColors are not supported'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message probably doesn't make sense in an XPR/RSD/Web context
| ): | ||
| | { components: [number, number, number, number], isColor: true } | ||
| | { components: $ReadOnlyArray<number | string>, isColor: false } { | ||
| let normalizedColor = normalizeColor(input); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way we could avoid the need for normalizeColor?
| return ( | ||
| <Animated.View | ||
| {...nativeProps} | ||
| style={[nativeProps.style, animatedStyle]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can animatedStyle be passed to compat.native so it picks up any relevant polyfills?
|
Hey @vincentriemer, what's the plan here? Did you make any progress on incorporating the viewport scaling polyfill into the animated values? |
|
@necolas @vincentriemer great to see progress on cross-platform animations. Was wondering and trying to understand better how this relates to: #3 having a polyfill for Also curious about what was touched on this comment: #3 (comment) I assume the Animated vs reanimated topic can be controversial, but finding a way to make the animation library opt-in may help in quicker adoption (I'm guessing here that in the long term Animated on react-native will want to address the issues that reanimated tries to fix?) The whole JS thread vs UI thread topic is also quite interesting in relation to react-strict-dom: in a way having something like a UI thread is in sync with what happens on web where css animations runs on the gpu. Probably some of those comments have already been discussed in depth in the RN community, and for sure I lack some context, but I'm trying to gauge the position and vision of RSD on this. |
|
This animation library enables different things to CSS keyframes The plan is for Animated and Reanimated to share the same C++ backend. We use the C++ Animated internally; no need to switch out for Reanimated. That will make its way to OSS eventually |
This introduces a new package to the RSD repo that provides a subset of React Native's API that works on both web and native, and built with integration of react-strict-dom in mind. The native implementation is largely a thin passthrough to the proper Animated API and some settings pre-configured (such as
useAnimatedDriveralways being enabled).The web side is a new Animated implementation that ends up being driven by the Web Animations API.