-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,192 additions
and
1,618 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "restricted", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js 18 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install Dependencies | ||
run: yarn | ||
|
||
- name: Create Release Pull Request or Publish to npm | ||
id: changesets | ||
uses: changesets/action@v1 | ||
with: | ||
# This expects you to have a script called release which does a build for your packages and calls changeset publish | ||
publish: yarn release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ dist | |
tsconfig.tsbuildinfo | ||
yarn-error.log | ||
.vscode | ||
.DS_STORE | ||
.DS_STORE | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
[submodule "apps/supabase-todolist"] | ||
path = apps/supabase-todolist | ||
url = [email protected]:journeyapps/powersync-supabase-react-native-todolist-demo.git | ||
[submodule "packages/journeyapps-react-native-quick-sqlite"] | ||
path = packages/journeyapps-react-native-quick-sqlite | ||
url = [email protected]:journeyapps/react-native-quick-sqlite.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule supabase-todolist
updated
from ee6acd to 3e6c35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule journeyapps-react-native-quick-sqlite
deleted from
6fc07f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# @journeyapps/powersync-react | ||
|
||
## 0.0.1 | ||
|
||
### Patch Changes | ||
|
||
- 5abb174: Fix issue with PowerSync React hooks that caused an infinite re-renders, when no `parameters` are provided | ||
- 822bab9: Bump version to exit prerelease mode. Update SDK readme with known issues. | ||
- Updated dependencies [aad52c8] | ||
- Updated dependencies [822bab9] | ||
- @journeyapps/powersync-sdk-common@0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
import React from 'react'; | ||
import { usePowerSync } from './PowerSyncContext'; | ||
import React from "react"; | ||
import { usePowerSync } from "./PowerSyncContext"; | ||
|
||
/** | ||
* A hook to access a single static query. | ||
* For an updated result, use usePowerSyncWatchedQuery instead | ||
*/ | ||
export const usePowerSyncQuery = <T = any>(sqlStatement: string, parameters: any[] = []): T[] => { | ||
export const usePowerSyncQuery = <T = any>( | ||
sqlStatement: string, | ||
parameters: any[] = [] | ||
): T[] => { | ||
const powerSync = usePowerSync(); | ||
if (!powerSync) { | ||
return []; | ||
} | ||
|
||
// This will return the previous parameters until the contents of parameters array change, | ||
// thereby providing a stable array reference and preventing excessive useEffect runs | ||
const memoizedParams = React.useMemo(() => parameters, [...parameters]); | ||
const [data, setData] = React.useState<T[]>([]); | ||
|
||
React.useEffect(() => { | ||
powerSync.execute(sqlStatement, parameters).then((result) => { | ||
setData(result.rows?._array ?? []); | ||
}); | ||
}, [powerSync, sqlStatement, parameters]); | ||
// | ||
}, [powerSync, sqlStatement, memoizedParams]); | ||
|
||
return data; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# @journeyapps/powersync-sdk-common | ||
|
||
## 0.0.1 | ||
|
||
### Patch Changes | ||
|
||
- aad52c8: Updated watched queries to trigger for local only tables. | ||
- 822bab9: Bump version to exit prerelease mode. Update SDK readme with known issues. | ||
|
||
## 0.0.1-alpha.1 | ||
|
||
### Patch Changes | ||
|
||
- aad52c8: Updated watched queries to trigger for local only tables. |
Oops, something went wrong.