Skip to content

Commit

Permalink
Upgrade to RN 0.74 and Expo SDK 51 (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
alantoa authored May 21, 2024
1 parent 7286e7e commit 644d768
Show file tree
Hide file tree
Showing 28 changed files with 17,558 additions and 17,974 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ example/ios/Pods
#
node_modules/
npm-debug.log

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
yarn-debug.log
yarn-error.log

Expand All @@ -58,3 +66,8 @@ android/keystores/debug.keystore

# generated by bob
lib/

# Native
example/ios
example/android
example/.expo
541 changes: 541 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

875 changes: 875 additions & 0 deletions .yarn/releases/yarn-3.8.2.cjs

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions .yarnrc

This file was deleted.

11 changes: 11 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
nmHoistingLimits: workspaces

nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.8.2.cjs
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1020,12 +1020,12 @@ const { currentX, currentY, currentIndex, data, domain, isActive } =

| Variable | Type | Default | Description |
| -------------- | --------------------------------------------- | ------- | ------------------------------- |
| `currentX` | `Animated.SharedValue<number>` | | Current x position |
| `currentY` | `Animated.SharedValue<number>` | | Current y position |
| `currentIndex` | `Animated.SharedValue<number>` | | Current index of the data |
| `currentX` | `SharedValue<number>` | | Current x position |
| `currentY` | `SharedValue<number>` | | Current y position |
| `currentIndex` | `SharedValue<number>` | | Current index of the data |
| `data` | `Array<{ timestamp: number, value: number }>` | | Data of the chart |
| `domain` | `[number, number]` | | Y domain of the chart |
| `isActive` | `Animated.SharedValue<boolean>` | | Is the chart active by gesture? |
| `isActive` | `SharedValue<boolean>` | | Is the chart active by gesture? |

### LineChart.useDatetime

Expand Down Expand Up @@ -1090,8 +1090,8 @@ const { currentX, currentY, data, domain, step } = CandlestickChart.useChart();

| Variable | Type | Default | Description |
| ---------- | -------------------------------------------------------------------------------------- | ------- | ------------------------- |
| `currentX` | `Animated.SharedValue<number>` | | Current x position |
| `currentY` | `Animated.SharedValue<number>` | | Current y position |
| `currentX` | `SharedValue<number>` | | Current x position |
| `currentY` | `SharedValue<number>` | | Current y position |
| `data` | `Array<{ timestamp: number, open: number, high: number, low: number, close: number }>` | | Data of the chart |
| `domain` | `[number, number]` | | Y domain of the chart |
| `step` | `number` | | Current index of the data |
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
presets: ['module:@react-native/babel-preset'],
};
42 changes: 42 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@


# @generated expo-cli sync-b5df6a44d8735348b729920a7406b633cfb74d4c
# The following patterns were generated by expo-cli

# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

# @end expo-cli
28 changes: 9 additions & 19 deletions example/app.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
{
"name": "react-native-wagmi-charts-example",
"displayName": "CandlestickChart Example",
"expo": {
"name": "react-native-wagmi-charts-example",
"slug": "react-native-wagmi-charts-example",
"description": "Example app for react-native-wagmi-charts",
"privacy": "public",
"version": "1.0.0",
"platforms": [
"ios",
"android",
"web"
],
"ios": {
"supportsTablet": true
},
"assetBundlePatterns": [
"**/*"
]
}
"slug": "react-native-wagmi-charts-example",
"description": "Example app for react-native-wagmi-charts",
"version": "1.0.0",
"platforms": ["ios", "android", "web"],
"ios": {
"supportsTablet": true
},
"assetBundlePatterns": ["**/*"],
"plugins": ["expo-asset"]
}
35 changes: 19 additions & 16 deletions example/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
const path = require('path');
const blacklist = require('metro-config/src/defaults/exclusionList');
const escape = require('escape-string-regexp');
const { getDefaultConfig } = require('@expo/metro-config');
const exclusionList = require('metro-config/src/defaults/exclusionList');
const pak = require('../package.json');

const root = path.resolve(__dirname, '..');
const modules = Object.keys({ ...pak.peerDependencies });

const modules = Object.keys({
...pak.peerDependencies,
});
const defaultConfig = getDefaultConfig(__dirname);

/**
* Metro configuration
* https://facebook.github.io/metro/docs/configuration
*
* @type {import('metro-config').MetroConfig}
*/
const config = {
...defaultConfig,

module.exports = {
projectRoot: __dirname,
watchFolders: [root],

// We need to make sure that only one version is loaded for peerDependencies
// So we blacklist them at the root, and alias them to the versions in example's node_modules
// So we block them at the root, and alias them to the versions in example's node_modules
resolver: {
blacklistRE: blacklist(
...defaultConfig.resolver,

blacklistRE: exclusionList(
modules.map(
(m) =>
new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
Expand All @@ -28,13 +38,6 @@ module.exports = {
return acc;
}, {}),
},

transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
};

module.exports = config;
34 changes: 17 additions & 17 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"name": "react-native-wagmi-charts-example",
"description": "Example app for react-native-wagmi-charts",
"version": "0.0.1",
"version": "1.0.0",
"private": true,
"main": "index",
"scripts": {
"android": "npx expo start --android",
"ios": "npx expo start --ios",
Expand All @@ -13,30 +12,31 @@
"postinstall": "patch-package"
},
"dependencies": {
"@types/react": "~18.2.14",
"@types/react": "~18.2.79",
"bumbag": "^2.2.1",
"bumbag-native": "^2.3.0",
"expo": "^49.0.0",
"expo-haptics": "~12.4.0",
"expo-splash-screen": "~0.20.5",
"expo": "~51.0.6",
"expo-crypto": "^13.0.2",
"expo-haptics": "~13.0.1",
"expo-splash-screen": "~0.27.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.3",
"react-native-gesture-handler": "~2.12.0",
"react-native-reanimated": "~3.3.0",
"react-native-svg": "13.9.0",
"react-native-web": "~0.19.6"
"react-native": "^0.74.1",
"react-native-gesture-handler": "~2.16.1",
"react-native-reanimated": "~3.10.1",
"react-native-redash": "^18.1.3",
"react-native-svg": "15.2.0",
"react-native-web": "~0.19.10"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/core": "^7.24.0",
"@babel/runtime": "^7.20.0",
"@expo/webpack-config": "^18.0.1",
"@expo/webpack-config": "~19.0.1",
"babel-loader": "^8.2.3",
"babel-plugin-module-resolver": "^4.1.0",
"babel-preset-expo": "^9.5.0",
"babel-plugin-module-resolver": "^5.0.2",
"babel-preset-expo": "~11.0.0",
"jsonfile": "^6.1.0",
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"typescript": "^5.1.3"
"typescript": "~5.3.3"
}
}
10 changes: 6 additions & 4 deletions example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"compilerOptions": {
"alias": {}
},
"extends": "../tsconfig.json"
"extends": "../tsconfig",
"compilerOptions": {},
"include": [
"**/*.ts",
"**/*.tsx"
]
}
5 changes: 4 additions & 1 deletion example/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ const node_modules = path.join(__dirname, 'node_modules');

module.exports = async function (env, argv) {
const config = await createExpoWebpackConfigAsync(env, argv);

config.resolve.fallback = {
...config.resolve.fallback,
crypto: require.resolve('expo-crypto'),
}
config.module.rules.push({
test: /\.(js|jsx|ts|tsx)$/,
include: path.resolve(root, 'src'),
Expand Down
Loading

0 comments on commit 644d768

Please sign in to comment.