Skip to content

Commit 9b388e6

Browse files
authored
feat!: Add Expo 54/reanimated 4 support and dynamic sizing capabilities (v5.0.0-beta.1) (#850)
* chore: update .gitignore to exclude local agent documentation files * chore: update Babel configuration and clean up project structure * chore: update Tamagui configuration and dependencies * feat: support automatic layout measurement * chore: remove workspace configuration and install limits from package.json * chore: generate changeset * chore: update package dependencies and add migration guide for v5.x * chore: update yarn.lock to remove deprecated dependencies and add new versions
1 parent 814f8e3 commit 9b388e6

File tree

86 files changed

+369732
-6671
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+369732
-6671
lines changed

.babelrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

.changeset/honest-baboons-sip.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
"react-native-reanimated-carousel": major
3+
---
4+
5+
# 🎯 Support for Expo 54 & Dynamic Sizing
6+
7+
## ✨ Major Features
8+
9+
### Dynamic Sizing Support
10+
- **Auto-sizing**: `width` and `height` props are now optional. Carousel automatically measures container dimensions via layout
11+
12+
### Expo 54 Compatibility
13+
- Full support for Expo SDK 54
14+
- Updated dependencies for latest React Native ecosystem
15+
16+
## 💥 Breaking Changes
17+
18+
### Dependencies Update Required
19+
- **react-native-reanimated**: Upgrade to `^4.1.0` (was `^3.0.0`)
20+
- **react-native-worklets**: New peer dependency `^0.5.1` required
21+
- **react-native-gesture-handler**: Minimum version `^2.9.0` (no breaking changes)
22+
23+
### Migration Steps
24+
1. Upgrade Reanimated: `npm install react-native-reanimated@^4.1.0`
25+
2. Install Worklets: `npm install react-native-worklets@^0.5.1`
26+
3. Follow Reanimated 4.0 migration guide for any breaking changes
27+
28+
## 🔧 Technical Improvements
29+
- Replaced deprecated `runOnJS` with `scheduleOnRN` from react-native-worklets
30+
- Enhanced test coverage for dynamic sizing scenarios
31+
- Improved overscroll protection logic
32+
- Better error handling for edge cases
33+
34+
## 📚 Documentation
35+
- Updated installation guide with new dependency requirements
36+
- Added migration guide from v4 to v5
37+
- Enhanced examples showcasing dynamic sizing capabilities
38+
39+
**Fixes**: #668 - Auto height calculation support

.changeset/pre.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"mode": "pre",
3+
"tag": "beta",
4+
"initialVersions": {
5+
"react-native-reanimated-carousel": "4.0.3"
6+
},
7+
"changesets": []
8+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,6 @@ coverage/
7979

8080
# Issue tasks
8181
.issue-tasks/
82+
83+
# Agents Docs
84+
*.local.md

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@
1616
- [Getting Started](https://rn-carousel.dev)
1717
- [Examples](https://rn-carousel.dev/Examples/summary)
1818

19+
## 📊 Version Compatibility
20+
21+
| Carousel Version | Expo SDK | React Native | Reanimated | Gesture Handler | Worklets |
22+
|------------------|----------|--------------|------------|-----------------|------------|
23+
| **v5.0.0-beta** | **54+** | **0.80+** | **4.0.0+** | **2.9.0+** | **0.5.0+** |
24+
| v4.x | 50-53 | 0.70.3+ | 3.0.0+ | 2.9.0+ ||
25+
| v3.x | 47-49 | 0.66.0+ | 2.0.0+ | 2.0.0+ ||
26+
27+
1928
## Sponsors
2029

2130
<p align="center">

babel.config.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
module.exports = {
2-
presets: ["module:metro-react-native-babel-preset"],
2+
presets: [
3+
[
4+
"@babel/preset-typescript",
5+
{
6+
allowNamespaces: true,
7+
isTSX: true,
8+
allExtensions: true,
9+
},
10+
],
11+
"@react-native/babel-preset",
12+
],
313
plugins: [
4-
"@babel/plugin-proposal-class-properties",
5-
"@babel/plugin-proposal-private-methods",
6-
"react-native-reanimated/plugin",
14+
"@babel/plugin-syntax-typescript",
15+
"react-native-worklets/plugin",
716
"@babel/plugin-syntax-dynamic-import",
817
],
918
};

biome.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@
5757
"example/app/android/**/*",
5858
"scripts/**/*",
5959
"package.json",
60-
"junit.xml"
60+
"junit.xml",
61+
"example/app/.tamagui/tamagui.config.json",
62+
".changeset"
6163
]
6264
}
6365
}

docs/ARCHITECTURE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ useAnimatedReaction(
399399
},
400400
({ offsetProgress, absoluteProgress }) => {
401401
if (typeof onProgressChange === "function") {
402-
runOnJS(onProgressChange)(offsetProgress, absoluteProgress);
402+
scheduleOnRN(onProgressChange, offsetProgress, absoluteProgress);
403403
} else if (onProgressChange) {
404404
onProgressChange.value = absoluteProgress;
405405
}
@@ -1900,10 +1900,10 @@ import 'react-native-reanimated/lib/reanimated2/jestUtils';
19001900
it('should update shared value correctly', () => {
19011901
const sharedValue = useSharedValue(0);
19021902

1903-
// Use runOnJS for async assertions
1903+
// Use scheduleOnRN for async assertions
19041904
const expectation = jest.fn();
19051905

1906-
runOnJS(expectation)(sharedValue.value);
1906+
scheduleOnRN(expectation, sharedValue.value);
19071907

19081908
expect(expectation).toHaveBeenCalledWith(expectedValue);
19091909
});

0 commit comments

Comments
 (0)