From 62073552a739176192f65908ca38e349d0951349 Mon Sep 17 00:00:00 2001 From: Alex Brazier Date: Fri, 6 Mar 2026 14:29:19 +0000 Subject: [PATCH 1/3] Update dependencies, RN 83 --- example/package.json | 18 +- example/src/App.tsx | 99 +- example/src/apolloClient.ts | 50 +- package.json | 10 +- src/components/RequestDetails.tsx | 2 + yarn.lock | 6647 ++++++++++++++--------------- 6 files changed, 3200 insertions(+), 3626 deletions(-) diff --git a/example/package.json b/example/package.json index 30e9118..1d9a542 100644 --- a/example/package.json +++ b/example/package.json @@ -12,17 +12,19 @@ "test": "jest" }, "dependencies": { - "@apollo/client": "^3.13.8", - "expo": "~53.0.9", + "@apollo/client": "^4.1.6", + "expo": "~55.0.5", "graphql": "^16.11.0", - "react": "~19.0.0", - "react-native": "0.79.2" + "react": "19.2.0", + "react-native": "0.83.2", + "react-native-safe-area-context": "^5.7.0" }, "devDependencies": { - "@babel/core": "^7.27.1", - "@babel/runtime": "^7.27.1", - "@react-native/metro-config": "^0.79.2", - "react-native-builder-bob": "^0.40.10" + "@babel/core": "^7.29.0", + "@babel/runtime": "^7.28.6", + "@react-native/metro-config": "^0.84.1", + "babel-preset-expo": "^55.0.10", + "react-native-builder-bob": "^0.40.18" }, "resolutions": { "semver": "^7.5.4" diff --git a/example/src/App.tsx b/example/src/App.tsx index 3cc9a51..8b57842 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -2,7 +2,6 @@ import React, { useCallback, useLayoutEffect, useState } from 'react'; import { StyleSheet, Button, - SafeAreaView, View, Text, TouchableOpacity, @@ -14,11 +13,18 @@ import NetworkLogger, { startNetworkLogging, stopNetworkLogging, } from 'react-native-network-logger'; -import { getHero, getRates, getUser } from './apolloClient'; +import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'; +import { getTodos } from './apolloClient'; const formData = new FormData(); formData.append('test', 'hello'); +const fetchStatus = async (status: number, sleepSeconds?: number) => { + return fetch(`https://httpbin.org/status/${status}`, { + headers: { 'X-HttpBin-Sleep': `${sleepSeconds || 0}` }, + }); +}; + const requests = [ async () => fetch( @@ -35,29 +41,27 @@ const requests = [ method: 'POST', body: formData, }), - async () => fetch('https://httpstat.us/200', { method: 'HEAD' }), + async () => fetch('https://httpbin.org/status/200', { method: 'HEAD' }), async () => fetch('https://postman-echo.com/put', { method: 'PUT', body: JSON.stringify({ test: 'hello' }), }), - async () => fetch('https://httpstat.us/200?sleep=300'), - async () => fetch('https://httpstat.us/204?sleep=200'), - async () => fetch('https://httpstat.us/302?sleep=200'), - async () => fetch('https://httpstat.us/400?sleep=200'), - async () => fetch('https://httpstat.us/401?sleep=200'), - async () => fetch('https://httpstat.us/403?sleep=200'), - async () => fetch('https://httpstat.us/404?sleep=400'), - async () => fetch('https://httpstat.us/500?sleep=5000'), - async () => fetch('https://httpstat.us/503?sleep=200'), - async () => fetch('https://httpstat.us/504?sleep=10000'), + async () => fetchStatus(200, 0.3), + async () => fetchStatus(204, 0.2), + async () => fetchStatus(302, 0.2), + async () => fetchStatus(400, 0.2), + async () => fetchStatus(401, 0.2), + async () => fetchStatus(403, 0.2), + async () => fetchStatus(404, 0.4), + async () => fetchStatus(500, 5), + async () => fetchStatus(503, 0.2), + async () => fetchStatus(504, 10), // Non JSON response async () => fetch('https://postman-echo.com/stream/2'), - async () => getRates(), // 405 - async () => getHero(), // 400 - async () => getUser(), // 200 + async () => getTodos(), // Test requests that fail // async () => fetch('https://failingrequest'), ]; @@ -78,7 +82,7 @@ export default function App() { startNetworkLogging({ ignoredHosts: ['127.0.0.1'], maxRequests, - ignoredUrls: ['https://httpstat.us/other'], + ignoredUrls: ['https://httpbin.org/status/other'], ignoredPatterns: [/^POST http:\/\/(192|10)/, /\/logs$/, /\/symbolicate$/], }); }, []); @@ -118,36 +122,38 @@ export default function App() { ); return ( - - - - - {'‹'} - - - react-native-network-logger - - - - {(unmountNetworkLogger && remountButton) || ( - - )} - -