Skip to content
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
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

39 changes: 39 additions & 0 deletions .changeset/honest-baboons-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
"react-native-reanimated-carousel": major
---

# 🎯 Support for Expo 54 & Dynamic Sizing

## ✨ Major Features

### Dynamic Sizing Support
- **Auto-sizing**: `width` and `height` props are now optional. Carousel automatically measures container dimensions via layout

### Expo 54 Compatibility
- Full support for Expo SDK 54
- Updated dependencies for latest React Native ecosystem

## πŸ’₯ Breaking Changes

### Dependencies Update Required
- **react-native-reanimated**: Upgrade to `^4.1.0` (was `^3.0.0`)
- **react-native-worklets**: New peer dependency `^0.5.1` required
- **react-native-gesture-handler**: Minimum version `^2.9.0` (no breaking changes)

### Migration Steps
1. Upgrade Reanimated: `npm install react-native-reanimated@^4.1.0`
2. Install Worklets: `npm install react-native-worklets@^0.5.1`
3. Follow Reanimated 4.0 migration guide for any breaking changes

## πŸ”§ Technical Improvements
- Replaced deprecated `runOnJS` with `scheduleOnRN` from react-native-worklets
- Enhanced test coverage for dynamic sizing scenarios
- Improved overscroll protection logic
- Better error handling for edge cases

## πŸ“š Documentation
- Updated installation guide with new dependency requirements
- Added migration guide from v4 to v5
- Enhanced examples showcasing dynamic sizing capabilities

**Fixes**: #668 - Auto height calculation support
8 changes: 8 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mode": "pre",
"tag": "beta",
"initialVersions": {
"react-native-reanimated-carousel": "4.0.3"
},
"changesets": []
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,6 @@ coverage/

# Issue tasks
.issue-tasks/

# Agents Docs
*.local.md
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
- [Getting Started](https://rn-carousel.dev)
- [Examples](https://rn-carousel.dev/Examples/summary)

## πŸ“Š Version Compatibility

| Carousel Version | Expo SDK | React Native | Reanimated | Gesture Handler | Worklets |
|------------------|----------|--------------|------------|-----------------|------------|
| **v5.0.0-beta** | **54+** | **0.80+** | **4.0.0+** | **2.9.0+** | **0.5.0+** |
| v4.x | 50-53 | 0.70.3+ | 3.0.0+ | 2.9.0+ | ❌ |
| v3.x | 47-49 | 0.66.0+ | 2.0.0+ | 2.0.0+ | ❌ |


## Sponsors

<p align="center">
Expand Down
17 changes: 13 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
module.exports = {
presets: ["module:metro-react-native-babel-preset"],
presets: [
[
"@babel/preset-typescript",
{
allowNamespaces: true,
isTSX: true,
allExtensions: true,
},
],
"@react-native/babel-preset",
],
plugins: [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-private-methods",
"react-native-reanimated/plugin",
"@babel/plugin-syntax-typescript",
"react-native-worklets/plugin",
"@babel/plugin-syntax-dynamic-import",
],
};
4 changes: 3 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@
"example/app/android/**/*",
"scripts/**/*",
"package.json",
"junit.xml"
"junit.xml",
"example/app/.tamagui/tamagui.config.json",
".changeset"
]
}
}
6 changes: 3 additions & 3 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ useAnimatedReaction(
},
({ offsetProgress, absoluteProgress }) => {
if (typeof onProgressChange === "function") {
runOnJS(onProgressChange)(offsetProgress, absoluteProgress);
scheduleOnRN(onProgressChange, offsetProgress, absoluteProgress);
} else if (onProgressChange) {
onProgressChange.value = absoluteProgress;
}
Expand Down Expand Up @@ -1900,10 +1900,10 @@ import 'react-native-reanimated/lib/reanimated2/jestUtils';
it('should update shared value correctly', () => {
const sharedValue = useSharedValue(0);

// Use runOnJS for async assertions
// Use scheduleOnRN for async assertions
const expectation = jest.fn();

runOnJS(expectation)(sharedValue.value);
scheduleOnRN(expectation, sharedValue.value);

expect(expectation).toHaveBeenCalledWith(expectedValue);
});
Expand Down
Loading