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
31 changes: 31 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Checks

on:
push:
branches: [main]
pull_request:
types: [opened, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repository
uses: actions/checkout@v4

- name: 🏗 Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: 📦 Install dependencies
run: bun install --frozen-lockfile

- name: 🔍 Check apps
run: |
bun run lint:apps
bun run typecheck:apps
3 changes: 2 additions & 1 deletion apps/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"ios": "expo run:ios",
"web": "expo start --web",
"lint": "expo lint",
"fix-deps": "expo install --check"
"fix-deps": "expo install --check",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@apollo/client": "^3.11.10",
Expand Down
2 changes: 1 addition & 1 deletion apps/example/src/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useReactNavigationDevTools } from '@dev-plugins/react-navigation';
import FontAwesome from '@expo/vector-icons/FontAwesome';
import { useFonts } from 'expo-font';
import { SplashScreen, Stack , useNavigationContainerRef } from 'expo-router';
import { SplashScreen, Stack, useNavigationContainerRef } from 'expo-router';
import { useEffect } from 'react';
import { StatusBar } from 'expo-status-bar';

Expand Down
16 changes: 8 additions & 8 deletions apps/example/src/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ export default function TesterScreen() {
<SafeAreaView style={styles.outerContainer}>
<Stack.Screen options={{ headerShown: false }} />
<View style={styles.container}>
<TestCase title="Apollo Client" route="/apollo-client/" />
<TestCase title="React Query" route="/react-query/" />
<TestCase title="React Query Time" route="/react-query-time/" />
<TestCase title="TinyBase" route="/tinybase/" />
<TestCase title="Vanilla Log Viewer" route="/vanilla-log-viewer/" />
<TestCase title="Async Storage" route="/async-storage/" />
<TestCase title="React Native MMKV" route="/react-native-mmkv/" />
<TestCase title="Apollo Client" route="/apollo-client" />
<TestCase title="React Query" route="/react-query" />
<TestCase title="React Query Time" route="/react-query-time" />
<TestCase title="TinyBase" route="/tinybase" />
<TestCase title="Vanilla Log Viewer" route="/vanilla-log-viewer" />
<TestCase title="Async Storage" route="/async-storage" />
<TestCase title="React Native MMKV" route="/react-native-mmkv" />
</View>
</SafeAreaView>
);
}

function TestCase<T>({ title, route }: { title: string; route: LinkProps<T>['href'] }) {
function TestCase({ title, route }: { title: string; route: LinkProps['href'] }) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LinkProps is not generic type from newer expo-router

return (
<Link href={route} asChild>
<Pressable style={styles.testCaseContainer}>
Expand Down
1 change: 1 addition & 0 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"expo": "53.0.7",
"expo-module-scripts": "^4.1.7",
"graphql": "^16.9.0",
"react-dom": "19.1.0",
"typescript": "~5.8.3",
},
"peerDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "1.0.0",
"private": true,
"scripts": {
"lint:apps": "bun run --filter './apps/**' lint",
"typecheck:apps": "bun run --filter './apps/**' typecheck",
"postinstall": "./scripts/prepare-packages.js"
},
"workspaces": [
Expand Down
1 change: 1 addition & 0 deletions packages/apollo-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"expo": "53.0.7",
"expo-module-scripts": "^4.1.7",
"graphql": "^16.9.0",
"react-dom": "19.1.0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bun adds @apollo/client as different dep that example's apollo-client has react-dom peerDep and this plugin does not.
to resolve the type error, this is a workaround to add react-dom from the plugin, so that bun can treat the apollo/client as same package and same type

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting

"typescript": "~5.8.3"
},
"peerDependencies": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion packages/react-navigation/src/useReactNavigationDevTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ import { useEffect, useRef } from 'react';

import { ReduxExtensionAdapter } from './ReduxExtensionAdapter';

export function useReactNavigationDevTools(ref: React.RefObject<NavigationContainerRef<any>>) {
export function useReactNavigationDevTools(
ref: React.RefObject<NavigationContainerRef<any> | null>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as #70

) {
const client = useDevToolsPluginClient('react-navigation');
const adapterRef = useRef(new ReduxExtensionAdapter());
// @ts-ignore: Override global
globalThis.__REDUX_DEVTOOLS_EXTENSION__ = {
connect: () => adapterRef.current,
};
// @ts-ignore: useReduxDevToolsExtension does not accept null ref from NavigationContainerRefWithCurrent
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess the problem is actually from react-navigation/devtools

useReduxDevToolsExtension(ref);

useEffect(() => {
Expand Down