Skip to content

Commit cb012b3

Browse files
authored
chore: Update dependencies, RN 83 (#125)
* Update dependencies, RN 83 * Fix tests * Update node, fix tests
1 parent 19f7b85 commit cb012b3

7 files changed

Lines changed: 3157 additions & 3911 deletions

File tree

.github/workflows/actions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
run: corepack enable
1616
- uses: actions/setup-node@v4
1717
with:
18-
node-version: '20'
18+
node-version: '24'
1919
- run: yarn install --frozen-lockfile
2020
- run: yarn prepare
2121
- run: yarn lint
@@ -29,6 +29,6 @@ jobs:
2929
run: corepack enable
3030
- uses: actions/setup-node@v4
3131
with:
32-
node-version: '20'
32+
node-version: '24'
3333
- run: yarn install --frozen-lockfile
3434
- run: yarn test --coverage

example/package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@
1212
"test": "jest"
1313
},
1414
"dependencies": {
15-
"@apollo/client": "^3.13.8",
16-
"expo": "~53.0.9",
15+
"@apollo/client": "^4.1.6",
16+
"expo": "~55.0.5",
1717
"graphql": "^16.11.0",
18-
"react": "~19.0.0",
19-
"react-native": "0.79.2"
18+
"react": "19.2.0",
19+
"react-native": "0.83.2",
20+
"react-native-safe-area-context": "^5.7.0"
2021
},
2122
"devDependencies": {
22-
"@babel/core": "^7.27.1",
23-
"@babel/runtime": "^7.27.1",
24-
"@react-native/metro-config": "^0.79.2",
25-
"react-native-builder-bob": "^0.40.10"
23+
"@babel/core": "^7.29.0",
24+
"@babel/runtime": "^7.28.6",
25+
"@react-native/metro-config": "^0.84.1",
26+
"babel-preset-expo": "^55.0.10",
27+
"react-native-builder-bob": "^0.40.18"
2628
},
2729
"resolutions": {
2830
"semver": "^7.5.4"

example/src/App.tsx

Lines changed: 52 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { useCallback, useLayoutEffect, useState } from 'react';
22
import {
33
StyleSheet,
44
Button,
5-
SafeAreaView,
65
View,
76
Text,
87
TouchableOpacity,
@@ -14,11 +13,18 @@ import NetworkLogger, {
1413
startNetworkLogging,
1514
stopNetworkLogging,
1615
} from 'react-native-network-logger';
17-
import { getHero, getRates, getUser } from './apolloClient';
16+
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
17+
import { getTodos } from './apolloClient';
1818

1919
const formData = new FormData();
2020
formData.append('test', 'hello');
2121

22+
const fetchStatus = async (status: number, sleepSeconds?: number) => {
23+
return fetch(`https://httpbin.org/status/${status}`, {
24+
headers: { 'X-HttpBin-Sleep': `${sleepSeconds || 0}` },
25+
});
26+
};
27+
2228
const requests = [
2329
async () =>
2430
fetch(
@@ -35,29 +41,27 @@ const requests = [
3541
method: 'POST',
3642
body: formData,
3743
}),
38-
async () => fetch('https://httpstat.us/200', { method: 'HEAD' }),
44+
async () => fetch('https://httpbin.org/status/200', { method: 'HEAD' }),
3945
async () =>
4046
fetch('https://postman-echo.com/put', {
4147
method: 'PUT',
4248
body: JSON.stringify({ test: 'hello' }),
4349
}),
44-
async () => fetch('https://httpstat.us/200?sleep=300'),
45-
async () => fetch('https://httpstat.us/204?sleep=200'),
46-
async () => fetch('https://httpstat.us/302?sleep=200'),
47-
async () => fetch('https://httpstat.us/400?sleep=200'),
48-
async () => fetch('https://httpstat.us/401?sleep=200'),
49-
async () => fetch('https://httpstat.us/403?sleep=200'),
50-
async () => fetch('https://httpstat.us/404?sleep=400'),
51-
async () => fetch('https://httpstat.us/500?sleep=5000'),
52-
async () => fetch('https://httpstat.us/503?sleep=200'),
53-
async () => fetch('https://httpstat.us/504?sleep=10000'),
50+
async () => fetchStatus(200, 0.3),
51+
async () => fetchStatus(204, 0.2),
52+
async () => fetchStatus(302, 0.2),
53+
async () => fetchStatus(400, 0.2),
54+
async () => fetchStatus(401, 0.2),
55+
async () => fetchStatus(403, 0.2),
56+
async () => fetchStatus(404, 0.4),
57+
async () => fetchStatus(500, 5),
58+
async () => fetchStatus(503, 0.2),
59+
async () => fetchStatus(504, 10),
5460

5561
// Non JSON response
5662
async () => fetch('https://postman-echo.com/stream/2'),
5763

58-
async () => getRates(), // 405
59-
async () => getHero(), // 400
60-
async () => getUser(), // 200
64+
async () => getTodos(),
6165
// Test requests that fail
6266
// async () => fetch('https://failingrequest'),
6367
];
@@ -78,7 +82,7 @@ export default function App() {
7882
startNetworkLogging({
7983
ignoredHosts: ['127.0.0.1'],
8084
maxRequests,
81-
ignoredUrls: ['https://httpstat.us/other'],
85+
ignoredUrls: ['https://httpbin.org/status/other'],
8286
ignoredPatterns: [/^POST http:\/\/(192|10)/, /\/logs$/, /\/symbolicate$/],
8387
});
8488
}, []);
@@ -118,36 +122,38 @@ export default function App() {
118122
);
119123

120124
return (
121-
<SafeAreaView style={styles.container}>
122-
<StatusBar
123-
barStyle={isDark ? 'light-content' : 'dark-content'}
124-
backgroundColor={isDark ? '#2d2a28' : 'white'}
125-
/>
126-
<View style={styles.header}>
127-
<TouchableOpacity
128-
style={styles.navButton}
129-
testID="backButton"
130-
onPress={backHandler}
131-
hitSlop={{ top: 20, left: 20, bottom: 20, right: 20 }}
132-
>
133-
<Text style={styles.backButtonText}>{'‹'}</Text>
134-
</TouchableOpacity>
135-
<Text style={styles.title} accessibilityRole="header">
136-
react-native-network-logger
137-
</Text>
138-
<View style={styles.navButton} />
139-
</View>
140-
{(unmountNetworkLogger && remountButton) || (
141-
<NetworkLogger theme={theme} maxRows={10} />
142-
)}
143-
<View style={styles.bottomView}>
144-
<Button
145-
title="Toggle Theme"
146-
onPress={() => setTheme(theme === 'light' ? 'dark' : 'light')}
125+
<SafeAreaProvider>
126+
<SafeAreaView style={styles.container}>
127+
<StatusBar
128+
barStyle={isDark ? 'light-content' : 'dark-content'}
129+
backgroundColor={isDark ? '#2d2a28' : 'white'}
147130
/>
148-
<Button title="Make request" onPress={makeRequest} />
149-
</View>
150-
</SafeAreaView>
131+
<View style={styles.header}>
132+
<TouchableOpacity
133+
style={styles.navButton}
134+
testID="backButton"
135+
onPress={backHandler}
136+
hitSlop={{ top: 20, left: 20, bottom: 20, right: 20 }}
137+
>
138+
<Text style={styles.backButtonText}>{'‹'}</Text>
139+
</TouchableOpacity>
140+
<Text style={styles.title} accessibilityRole="header">
141+
react-native-network-logger
142+
</Text>
143+
<View style={styles.navButton} />
144+
</View>
145+
{(unmountNetworkLogger && remountButton) || (
146+
<NetworkLogger theme={theme} maxRows={10} />
147+
)}
148+
<View style={styles.bottomView}>
149+
<Button
150+
title="Toggle Theme"
151+
onPress={() => setTheme(theme === 'light' ? 'dark' : 'light')}
152+
/>
153+
<Button title="Make request" onPress={makeRequest} />
154+
</View>
155+
</SafeAreaView>
156+
</SafeAreaProvider>
151157
);
152158
}
153159

@@ -156,7 +162,6 @@ const themedStyles = (dark = false) =>
156162
container: {
157163
flex: 1,
158164
backgroundColor: dark ? '#2d2a28' : 'white',
159-
paddingTop: 0,
160165
},
161166
header: {
162167
flexDirection: 'row',

example/src/apolloClient.ts

Lines changed: 9 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,20 @@
1-
import { ApolloClient, InMemoryCache, gql } from '@apollo/client';
2-
3-
const sandboxClient = new ApolloClient({
4-
uri: 'https://48p1r2roz4.sse.codesandbox.io',
5-
cache: new InMemoryCache(),
6-
});
7-
8-
export const getRates = async () => {
9-
return sandboxClient
10-
.query({
11-
query: gql`
12-
query GetRates {
13-
rates(currency: "USD") {
14-
currency
15-
}
16-
}
17-
`,
18-
fetchPolicy: 'network-only',
19-
})
20-
.catch((e: any) => console.log(e.message));
21-
};
1+
import { ApolloClient, HttpLink, InMemoryCache, gql } from '@apollo/client';
222

233
const gqlZeroClient = new ApolloClient({
24-
uri: 'https://graphqlzero.almansi.me/api',
4+
link: new HttpLink({ uri: 'https://graphqlzero.almansi.me/api' }),
255
cache: new InMemoryCache(),
266
});
277

28-
export const getUser = async () => {
29-
return gqlZeroClient
30-
.query({
31-
query: gql`
32-
query getUser {
33-
user(id: 1) {
34-
id
35-
name
36-
}
37-
}
38-
`,
39-
})
40-
.catch((e: any) => console.log(e.message));
41-
};
42-
43-
export const getHero = async () => {
8+
export const getTodos = async () => {
449
return gqlZeroClient
4510
.query({
4611
query: gql`
47-
query getHero {
48-
hero(class: "Human") {
49-
health
12+
query getTodos {
13+
todos {
14+
data {
15+
id
16+
title
17+
}
5018
}
5119
}
5220
`,

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,23 @@
5656
"@eslint/compat": "^1.2.9",
5757
"@eslint/eslintrc": "^3.3.1",
5858
"@eslint/js": "^9.26.0",
59-
"@react-native/babel-preset": "0.78.2",
59+
"@react-native/babel-preset": "0.84.1",
6060
"@react-native/eslint-config": "^0.78.0",
61+
"@react-native/jest-preset": "^0.85.0-rc.0",
6162
"@release-it/conventional-changelog": "^10.0.1",
62-
"@testing-library/react-native": "~13.1.1",
63+
"@testing-library/react-native": "~13.3.3",
6364
"@types/jest": "^29.5.13",
64-
"@types/react": "^19.1.3",
65+
"@types/react": "^19.2.14",
6566
"eslint": "^9.26.0",
6667
"eslint-config-prettier": "^10.1.5",
6768
"eslint-plugin-prettier": "^5.4.0",
6869
"husky": "^9.1.6",
6970
"jest": "^29.7.0",
7071
"metro-react-native-babel-preset": "^0.77.0",
7172
"prettier": "^3.5.3",
72-
"react": "~19.0.0",
73-
"react-native": "0.79.2",
74-
"react-native-builder-bob": "^0.40.10",
73+
"react": "~19.2.0",
74+
"react-native": "0.83.3",
75+
"react-native-builder-bob": "^0.40.18",
7576
"react-test-renderer": "^19.1.0",
7677
"release-it": "^19.0.2",
7778
"rimraf": "^6.0.1",
@@ -85,7 +86,7 @@
8586
"registry": "https://registry.npmjs.org/"
8687
},
8788
"jest": {
88-
"preset": "react-native",
89+
"preset": "@react-native/jest-preset",
8990
"modulePathIgnorePatterns": [
9091
"<rootDir>/example/node_modules",
9192
"<rootDir>/lib/"

src/components/RequestDetails.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ const themedStyles = (theme: Theme) =>
151151
},
152152
info: {
153153
margin: 0,
154+
maxHeight: 150,
154155
},
155156
close: {
156157
position: 'absolute',
@@ -174,6 +175,7 @@ const themedStyles = (theme: Theme) =>
174175
},
175176
largeContent: {
176177
maxHeight: 300,
178+
flex: 1,
177179
},
178180
});
179181

0 commit comments

Comments
 (0)