diff --git a/README.md b/README.md index 50db5b95..24d19d78 100644 --- a/README.md +++ b/README.md @@ -26,11 +26,11 @@ _Bad connectivity is everywhere, and we're tired of it. PowerSync is on a missio - [packages/powersync-attachments](./packages/powersync-attachments/README.md) - - Attachments helper package for React Native. + - Attachments helper package for React Native and JavaScript/TypeScript projects. - [packages/kysely-driver](./packages/kysely-driver/README.md) - - Kysely integration (ORM) for React Native and JS Web. + - Kysely integration (ORM) for React Native and JavaScript/TypeScript projects. - [packages/powersync-sdk-common](./packages/powersync-sdk-common/README.md) - Shared package: TypeScript implementation of a PowerSync database connector and streaming sync bucket implementation. diff --git a/demos/example-nextjs/README.md b/demos/example-nextjs/README.md index 45cb62c0..5bda517f 100644 --- a/demos/example-nextjs/README.md +++ b/demos/example-nextjs/README.md @@ -4,7 +4,7 @@ This example is built using [Next.js](https://nextjs.org/) and the [PowerSync JS To see it in action: -1. Make sure to run `pnpm build:packages` in the root directory of this Git repo. +1. Make sure to run `pnpm install` and `pnpm build:packages` in the root directory of this repo. 2. Copy `.env.local.template` to `.env.local`, and complete the environment variables. You can generate a [temporary development token](https://docs.powersync.com/usage/installation/authentication-setup/development-tokens), or leave blank to test with local-only data. -3. `pnpm start` -4. Open the localhost URL in the browser displayed in the terminal output. +3. cd into this directory and run `pnpm start`. +4. Open the localhost URL displayed in the terminal output in your browser. diff --git a/demos/example-vite/README.md b/demos/example-vite/README.md index 092f1ff8..7221f637 100644 --- a/demos/example-vite/README.md +++ b/demos/example-vite/README.md @@ -1,7 +1,9 @@ # PowerSync Vite bundling test +This is a minimal example demonstrating bundling with Vite. It attempts a connection to verify that web workers load correctly, but networks requests will fail since no credentials are configured. See [src/index.js](src/index.js) for details. + To see it in action: -1. Make sure to run `pnpm build:packages` in the root directory of this Git repo. -2. `pnpm start` -3. Open the localhost URL in the browser displayed in the terminal output. +1. Make sure to run `pnpm install` and `pnpm build:packages` in the root directory of this repo. +2. cd into this directory, and run `pnpm start`. +3. Open the localhost URL displayed in the terminal output in your browser. diff --git a/demos/example-vite/src/index.js b/demos/example-vite/src/index.js index 67cdafcc..64304c8f 100644 --- a/demos/example-vite/src/index.js +++ b/demos/example-vite/src/index.js @@ -31,11 +31,7 @@ let PowerSync; const openDatabase = async () => { PowerSync = new WASQLitePowerSyncDatabaseOpenFactory({ schema: AppSchema, - dbFilename: 'test.sqlite', - flags: { - // This is disabled once CSR+SSR functionality is verified to be working correctly - disableSSRWarning: true - } + dbFilename: 'test.sqlite' }).getInstance(); await PowerSync.init(); @@ -61,6 +57,5 @@ const openDatabase = async () => { }; document.addEventListener('DOMContentLoaded', (event) => { - console.log('hello'); openDatabase(); }); diff --git a/demos/example-webpack/README.md b/demos/example-webpack/README.md index 209c7c52..b44cee34 100644 --- a/demos/example-webpack/README.md +++ b/demos/example-webpack/README.md @@ -1,7 +1,9 @@ # PowerSync Webpack bundling test +This is a minimal example demonstrating bundling with Webpack. It attempts a connection to verify that web workers load correctly, but networks requests will fail since no credentials are configured. See [src/index.js](src/index.js) for details. + To see it in action: -1. Make sure to run `pnpm build:packages` in the root directory of this Git repo. -2. `pnpm start` -3. Open the localhost URL in the browser displayed in the terminal output. +1. Make sure to run `pnpm install` and `pnpm build:packages` in the root directory of this repo. +2. cd into this directory, and run `pnpm start`. +3. Open the localhost URL displayed in the terminal output in your browser. diff --git a/demos/example-webpack/src/index.js b/demos/example-webpack/src/index.js index 4cfb5fcd..97205c43 100644 --- a/demos/example-webpack/src/index.js +++ b/demos/example-webpack/src/index.js @@ -6,6 +6,22 @@ import { Table } from '@journeyapps/powersync-sdk-web'; +/** + * A placeholder connector which doesn't do anything. + * This is just used to verify that the sync workers can be loaded + * when connecting. + */ +class DummyConnector { + async fetchCredentials() { + return { + endpoint: '', + token: '' + }; + } + + async uploadData(database) {} +} + export const AppSchema = new Schema([ new Table({ name: 'customers', columns: [new Column({ name: 'name', type: ColumnType.TEXT })] }) ]); @@ -25,8 +41,21 @@ const openDatabase = async () => { const result = await PowerSync.getAll('SELECT * FROM customers'); console.log('contents of customers: ', result); + + console.log( + `Attempting to connect in order to verify web workers are correctly loaded. + This doesn't use any actual network credentials. + Network errors will be shown: these can be ignored.` + ); + + /** + * Try and connect, this will setup shared sync workers + * This will fail due to not having a valid endpoint, + * but it will try - which is all that matters. + */ + await PowerSync.connect(new DummyConnector()); }; document.addEventListener('DOMContentLoaded', (event) => { openDatabase(); -}); +}); \ No newline at end of file diff --git a/packages/powersync-attachments/README.md b/packages/powersync-attachments/README.md index 5cd62172..c6d33725 100644 --- a/packages/powersync-attachments/README.md +++ b/packages/powersync-attachments/README.md @@ -1,6 +1,6 @@ # @journeyapps/powersync-attachments -A [PowerSync](https://powersync.co) library to manage attachments in TypeScript and React Native apps. +A [PowerSync](https://powersync.com) library to manage attachments in React Native and JavaScript/TypeScript apps. ## Installation