Skip to content
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

Add compatibility table #5122

Merged
merged 24 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ android {
def assertLatestReactNativeWithNewArchitecture = task assertLatestReactNativeWithNewArchitectureTask {
onlyIf { IS_NEW_ARCHITECTURE_ENABLED && REANIMATED_MAJOR_VERSION == 3 && REACT_NATIVE_MINOR_VERSION < 72 }
doFirst {
// If you change the minimal React Native version remember to update Compatibility Table in docs
throw new GradleException(
"[Reanimated] Outdated version of React Native for New Architecture. Reanimated " + REANIMATED_VERSION + " supports the New Architecture on React Native 0.72.0+. See https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#outdated-version-of-react-native-for-new-architecture for more information."
)
Expand All @@ -390,6 +391,7 @@ def assertLatestReactNativeWithNewArchitecture = task assertLatestReactNativeWit
def assertMinimalReactNativeVersion = task assertMinimalReactNativeVersionTask {
onlyIf { REACT_NATIVE_MINOR_VERSION < 66 }
doFirst {
// If you change the minimal React Native version remember to update Compatibility Table in docs
throw new GradleException("[Reanimated] Unsupported React Native version. Please use 0.66 or newer.")
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/advanced/measure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const handlePress = () => {

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/advanced/setNativeProps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import SetNativePropsSrc from '!!raw-loader!@site/src/examples/SetNativeProps';

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/advanced/useAnimatedReaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function App() {

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/advanced/useFrameCallback.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ import FrameCallbackDinoSrc from '!!raw-loader!@site/src/examples/FrameCallbackD

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/animations/withDecay.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ import DecayTrainSrc from '!!raw-loader!@site/src/examples/DecayTrain';

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/animations/withDelay.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import DelayTextSrc from '!!raw-loader!@site/src/examples/DelayText';

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/animations/withRepeat.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ import SequenceWobbleSrc from '!!raw-loader!@site/src/examples/SequenceWobble';

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/animations/withSequence.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import SequenceWobbleSrc from '!!raw-loader!@site/src/examples/SequenceWobble';

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/animations/withSpring.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ import SpringCarouselSrc from '!!raw-loader!@site/src/examples/SpringCarousel';

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/animations/withTiming.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ import TimingTabsSrc from '!!raw-loader!@site/src/examples/TimingTabs';

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/core/cancelAnimation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import CancelAnimationSrc from '!!raw-loader!@site/src/examples/CancelAnimation'

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/core/createAnimatedComponent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import CreateAnimatedComponentSrc from '!!raw-loader!@site/src/examples/CreateAn

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/core/useAnimatedProps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ import AnimatingPropsSrc from '!!raw-loader!@site/src/examples/AnimatingProps';

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/core/useAnimatedRef.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Alternatively, you can get the value stored in the `current` in [event handlers]

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/core/useAnimatedStyle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const styles = StyleSheet.create({

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/core/useDerivedValue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import DerivedValueSrc from '!!raw-loader!@site/src/examples/DerivedValue';

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/core/useSharedValue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function App() {

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/device/useReducedMotion.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import UseReducedMotionSrc from '!!raw-loader!@site/src/examples/UseReducedMotio

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
41 changes: 41 additions & 0 deletions docs/docs/guides/compatibility.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
id: compatibility
sidebar_label: Compatibility
---

# Compatibility table

### Currently supported React Native versions (Paper)

<div className="compatibility">

| | 0.63 | 0.64 | 0.65 | 0.66 | 0.67 | 0.68 | 0.69 | 0.70 | 0.71 | 0.72 |
| ------------------------------------ | --------------- | --------------- | --------------- | ------------ | ------------ | --------------- | --------------- | --------------- | --------------- | --------------- |
| <Version version="3.4.x - 3.5.x"/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> |
| <Version version="3.1.x - 3.3.x"/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> |
| <Version version="3.0.x"/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <NotSupported/> |
| <Spacer/> | | | | | | | | | | |
| <Version version="2.14.x - 2.17.x"/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <NotSupported/> |
| <Version version="2.11.x - 2.13.x"/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <NotSupported/> | <NotSupported/> |
| <Version version="2.10.x"/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> |
| <Version version="2.5.x - 2.9.x"/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> |
| <Version version="2.3.x - 2.4.x"/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <Supported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> |

</div>

:::info
Reanimated 2 won't receive support for newest React Native versions. To get the latest React Native features and updates, upgrade to Reanimated 3.
:::

### Supported React Native versions on the New Architecture (Fabric)

To use Reanimated with [the experimental New Architecture](https://reactnative.dev/docs/the-new-architecture/landing-page), update the package to at least version 3.0.0. Due to the vast number of breaking-changes related to the New Architecture in each React Native version, as a rule of thumb Reanimated supports the latest stable version of React Native.

<div className="compatibility">

| | 0.63 | 0.64 | 0.65 | 0.66 | 0.67 | 0.68 | 0.69 | 0.70 | 0.71 | 0.72 |
| ---------------------------------- | --------------- | --------------- | --------------- | --------------- | --------------- | --------------- | --------------- | --------------- | --------------- | --------------- |
| <Version version="3.1.x - 3.5.x"/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <Supported/> |
| <Version version="3.0.x"/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <NotSupported/> | <Supported/> | <NotSupported/> |

</div>
3 changes: 2 additions & 1 deletion docs/docs/guides/troubleshooting.mdx
Latropos marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ See [Multiple versions of Reanimated were detected](#multiple-versions-of-reanim

**Problem:** Reanimated supports New Architecture (Fabric) only on the latest minor release of React Native.

**Solution:** Please upgrade to at least React Native 0.72 or downgrade to an older version of Reanimated 3.
**Solution:** Please upgrade to a newer version of React Native or downgrade to an older version of Reanimated.
See [the compatibility table](compatibility) for a full list of supported versions of React Native.

## Threading issues

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ ZoomIn.delay(500)

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/threading/createWorkletRuntime.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ An optional worklet that will be run synchronously on the same thread immediatel

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/threading/runOnJS.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ withTiming(0, {}, () => {

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/threading/runOnUI.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ import RunOnUISrc from '!!raw-loader!@site/src/examples/RunOnUI';

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/utilities/clamp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import ClampSrc from '!!raw-loader!@site/src/examples/Clamp';

## Platform compatibility

<div className="compatibility">
<div className="platform-compatibility">

| Android | iOS | Web |
| ------- | --- | --- |
Expand Down
22 changes: 22 additions & 0 deletions docs/src/components/Compatibility/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import styles from './styles.module.css';

export function Supported() {
return <div className={styles.supported}>yes</div>;
}

export function NotSupported() {
return <div className={styles.notSupported}>no</div>;
}

interface VersionProps {
version: string;
}

export function Version({ version }: VersionProps) {
return <div className={styles.version}>{version}</div>;
}

export function Spacer() {
return <div className={styles.spacer}></div>;
}
25 changes: 25 additions & 0 deletions docs/src/components/Compatibility/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.supported {
color: var(--swm-compatibility-text-color);
background-color: var(--swm-compatibility-supported-background);
text-align: center;
text-transform: capitalize;
padding: 12px;
}

.notSupported {
color: var(--swm-compatibility-text-color);
background-color: var(--swm-compatibility-not-supported-background);
text-align: center;
text-transform: capitalize;
padding: 12px;
}

.version {
font-weight: bold;
text-align: center;
padding: 12px;
}

.spacer {
padding-top: 10px;
}
10 changes: 10 additions & 0 deletions docs/src/css/colors.css
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@
/* Version badge */
--swm-version-badge: var(--swm-navy-light-100);
--swm-version-badge-background: var(--swm-navy-light-10);

/* Compatibility table */
--swm-compatibility-supported-background: var(--swm-green-light-80);
--swm-compatibility-not-supported-background: var(--swm-red-light-80);
--swm-compatibility-text-color: var(--swm-white);
}

:root[data-theme='dark'] {
Expand Down Expand Up @@ -425,6 +430,11 @@
/* Version badge */
--swm-version-badge: var(--swm-off-white);
--swm-version-badge-background: var(--swm-light-off-navy);

/* Compatibility table */
--swm-compatibility-supported-background: var(--swm-green-dark-120);
--swm-compatibility-not-supported-background: var(--swm-red-dark-120);
--swm-compatibility-text-color: var(--swm-navy-dark-20);
}

code {
Expand Down
23 changes: 22 additions & 1 deletion docs/src/css/overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,33 @@ table thead tr {
border-bottom: 1px solid var(--ifm-table-border-color);
}

.compatibility table {
.platform-compatibility table {
display: table;
width: 100%;
table-layout: fixed;
}

.compatibility {
overflow-x: auto;
}

.compatibility table {
display: table;
width: 100%;
white-space: nowrap;
}

.compatibility td {
padding: 0;
border: transparent 2px solid;
background: var(--ifm-background-color);
}

.compatibility th {
background: var(--ifm-background-color);
border: transparent 2px solid;
}

.header-github {
margin-left: 1.5em;
}
Expand Down
Loading
Loading