Skip to content

Commit

Permalink
fix React navtive
Browse files Browse the repository at this point in the history
  • Loading branch information
stevensJourney committed Jul 10, 2024
1 parent 27fd57c commit 04e35c1
Show file tree
Hide file tree
Showing 10 changed files with 20,015 additions and 15,466 deletions.
256 changes: 128 additions & 128 deletions demos/react-native-supabase-todolist/ios/Podfile.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@
"$(inherited)",
" ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
};
Expand Down Expand Up @@ -539,7 +539,7 @@
"$(inherited)",
" ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
VALIDATE_PRODUCT = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import { KVStorage } from '../storage/KVStorage';
import { PhotoAttachmentQueue } from './PhotoAttachmentQueue';
import { type AttachmentRecord } from '@powersync/attachments';
import { AppConfig } from '../supabase/AppConfig';
import Logger from 'js-logger';

Logger.useDefaults();

export class System {
kvStorage: KVStorage;
Expand Down
8 changes: 1 addition & 7 deletions demos/react-native-supabase-todolist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"@react-navigation/drawer": "^6.6.3",
"@react-navigation/native": "^6.0.0",
"@supabase/supabase-js": "^2.33.1",
"base-64": "^1.0.0",
"base64-arraybuffer": "^1.0.2",
"expo": "51.0.10",
"expo-build-properties": "~0.12.1",
Expand All @@ -40,20 +39,15 @@
"react-native": "0.74.1",
"react-native-elements": "^3.4.3",
"react-native-encrypted-storage": "^4.0.3",
"react-native-fetch-api": "^3.0.0",
"react-native-gesture-handler": "~2.16.2",
"react-native-polyfill-globals": "^3.1.0",
"react-native-prompt-android": "^1.1.0",
"react-native-reanimated": "~3.10.0",
"react-native-reanimated-table": "^0.0.2",
"react-native-safe-area-context": "4.10.1",
"react-native-safe-area-view": "^1.1.1",
"react-native-screens": "~3.31.1",
"react-native-url-polyfill": "^2.0.0",
"react-native-vector-icons": "^10.0.0",
"react-navigation-stack": "^2.10.4",
"text-encoding": "^0.7.0",
"web-streams-polyfill": "^3.3.2"
"react-navigation-stack": "^2.10.4"
},
"devDependencies": {
"@babel/core": "^7.23.9",
Expand Down
3 changes: 2 additions & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"access": "public"
},
"description": "API definitions for JourneyApps PowerSync",
"main": "lib/index.js",
"main": "dist/index.js",
"types": "lib/index.d.ts",
"author": "JOURNEYAPPS",
"license": "Apache-2.0",
Expand Down Expand Up @@ -48,6 +48,7 @@
"@types/uuid": "^9.0.1",
"bson": "^6.6.0",
"rollup": "4.14.3",
"text-encoding": "^0.7.0",
"typescript": "^5.1.3",
"vitest": "^1.5.2"
}
Expand Down
17 changes: 14 additions & 3 deletions packages/common/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,18 @@ export default (commandLineArgs) => {
nodeResolve({ preferBuiltins: false, browser: true }),
commonjs({}),
inject({
Buffer: ['buffer', 'Buffer']
Buffer: ['buffer', 'Buffer'],
ReadableStream: ['web-streams-polyfill', 'ReadableStream' ],
// Used by can-ndjson-stream
TextDecoder: ['text-encoding', 'TextDecoder']
})
],
// This makes life easier
external: [
// This has dynamic logic - makes bundling hard
'cross-fetch',
// TODO: make the useDefaults logic better. Currently need access to this package directly
'js-logger'
]
},
// Todo: This was just to have a copy of what I tried for react-native.
Expand All @@ -41,9 +51,10 @@ export default (commandLineArgs) => {
nodeResolve({ preferBuiltins: false, browser: true }),
commonjs({}),
inject({
Buffer: ['buffer', 'Buffer']
Buffer: ['buffer', 'Buffer'],

})
]
],
}
];
};
2 changes: 1 addition & 1 deletion packages/common/src/client/sync/stream/AbstractRemote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ export abstract class AbstractRemote {
}
});

const jsonS = ndjsonStream(new Response(outputStream).body);
const jsonS = ndjsonStream(outputStream);

const stream = new DataStream({
logger: this.logger
Expand Down
1 change: 1 addition & 0 deletions packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "15.2.3",
"@types/async-lock": "^1.4.0",
"crypto-browserify": "^3.12.0",
"react": "18.2.0",
"react-native": "0.72.4",
"rollup": "4.14.3",
Expand Down
2 changes: 2 additions & 0 deletions packages/react-native/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ export default (commandLineArgs) => {
],
external: [
'@journeyapps/react-native-quick-sqlite',
'@powersync/common',
'@powersync/react',
'node-fetch',
'js-logger',
'react-native',
'react-native/Libraries/Blob/BlobManager',
'react'
Expand Down
35,185 changes: 19,861 additions & 15,324 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

0 comments on commit 04e35c1

Please sign in to comment.