-
Notifications
You must be signed in to change notification settings - Fork 51
Incremental Watched Queries #614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
stevensJourney
wants to merge
112
commits into
main
Choose a base branch
from
watches
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+5,985
−1,797
Open
Changes from 66 commits
Commits
Show all changes
112 commits
Select commit
Hold shift + click to select a range
8eb570d
wip
stevensJourney 861fc2b
wip
stevensJourney f6b3ef4
Improve hook implementation
stevensJourney 6a18a4a
update tests to use web db
stevensJourney e6f902e
Add comparison test
stevensJourney ddbf6a3
cleanup
stevensJourney 9837ca9
limit stream depth
stevensJourney 7b15fc3
use abort signal
stevensJourney 8874c75
cleanup api
stevensJourney 7d1124c
Update generic typing and APIs
stevensJourney 69f7394
wip: react suspense
stevensJourney 83e99e2
wip: query interface
stevensJourney 4704723
cleanup interfaces
stevensJourney 79f809e
cleanup suspense hooks
stevensJourney b11c24e
wip: split suspense hooks
stevensJourney 9b86a63
git mv
stevensJourney e98e43f
cleanup hook folder structure
stevensJourney fccbd69
more hook cleanup
stevensJourney 0ce4ddf
git mv
stevensJourney 3009ac7
cleanup files
stevensJourney 151dc0a
temp
stevensJourney 0b4926e
rename
stevensJourney e4a8a2d
mv
stevensJourney f273312
more react cleanup
stevensJourney 83b1289
update unit tests
stevensJourney 719d396
Merge remote-tracking branch 'origin/main' into watches
stevensJourney 4c5b136
Add tests for shared queries
stevensJourney 4581a97
Merge remote-tracking branch 'origin/main' into watches
stevensJourney 40b849c
cleanup compatible queries
stevensJourney 81d68e3
maintain backwards compatibility
stevensJourney 65a0ea3
Simplify query options for watched queries
stevensJourney 5ba28b4
update React README
stevensJourney 9832417
cleanup React demo
stevensJourney 6036652
update vue unit tests to use an actual DB
stevensJourney c930e0e
fix unit tests. Improve closing behaviour.
stevensJourney 328aaa8
fix React tests
stevensJourney 642c11a
remove log
stevensJourney 40587bb
Merge remote-tracking branch 'origin/main' into watches
stevensJourney 4f54dab
cleanup
stevensJourney 3a6520e
use enums
stevensJourney aab75f3
cleanup
stevensJourney c3e4709
use a builder pattern to separate incremental watched query types.
stevensJourney c108094
fix web tests
stevensJourney a0e0c70
improve generics
stevensJourney 05f50f1
Add demo for instant query caching with localStorage
stevensJourney 0d01b97
revert headless setting
stevensJourney 12b6aa8
fix kysely test
stevensJourney 8208ac0
cleanup example JSDoc comments
stevensJourney 8a42cda
cleanup
stevensJourney cf8034f
wip add differential
stevensJourney 4edb977
cleanup interfaces
stevensJourney 5603bc5
Add unit tests for differential watch. Add transformer option to getA…
stevensJourney 540d841
Add differential query function.
stevensJourney eaeb729
Merge branch 'watched-differential' into watches
stevensJourney fbb3f8f
Merge remote-tracking branch 'origin/main' into watches
stevensJourney 23eb215
fix conflict
stevensJourney cd5a5c8
Add local development for YJS demo
stevensJourney 7afab68
Update YJS demo to use differential queries
stevensJourney 306cf43
unify watched query listeners and subscriptions to consistent API
stevensJourney 5bffa25
update yjs readme
stevensJourney 28b58c8
Merge remote-tracking branch 'origin/main' into watches
stevensJourney 1f9ffad
update changesets
stevensJourney 17680a5
fix multiple instance unit tests
stevensJourney 9c8e57d
Merge remote-tracking branch 'origin/main' into watches
stevensJourney 0b1e627
prevent concurrent web package tests
stevensJourney f86bca6
update vitest for hopefully better stability
stevensJourney 1c5f1ad
Add powerSync to dependency array
stevensJourney a913020
remove localStorage caching example
stevensJourney f8f7b6d
improve readonly mutability in types. Persist previous object referen…
stevensJourney 3a6bef6
Add automated profiling benchmarks
stevensJourney 5c7c76e
Invert Watched Query creation API. Update hook packages to provide di…
stevensJourney 3fbe208
cleanup docs. More readonly work.
stevensJourney 3cbfc8f
update docs and demos.
stevensJourney 271737c
update profile timeout
stevensJourney 2d241cc
wierd submodule
stevensJourney 0b8f9ae
skip profile tests by default
stevensJourney 937c1e2
fix tests
stevensJourney 860c362
Update hook results to be readonly
stevensJourney c591299
Add a nice chart to benchmarks
stevensJourney 657eda7
Merge remote-tracking branch 'origin/main' into watches
stevensJourney d4cf238
cleanup readme and docs
stevensJourney a98eb00
Revert breaking changes for react package.
stevensJourney be9cc12
cleanup console logs
stevensJourney c55dc01
Merge remote-tracking branch 'origin/main' into watches
stevensJourney 37120f6
add more doc comments
stevensJourney cab2bb6
Merge remote-tracking branch 'origin/main' into watches
stevensJourney 43f24fd
cleanup
stevensJourney 447de0a
Move Differential diff out of state to a listener.
stevensJourney 86f4bf0
Remove duplicate sync rules line
stevensJourney bf7a177
YJS: revert editor_id column
stevensJourney 39d7216
Merge remote-tracking branch 'origin/main' into watches
stevensJourney 1f1b076
increase timeout
stevensJourney 486395b
cleanup changelog
stevensJourney eacb8e7
Merge remote-tracking branch 'origin/main' into watches
stevensJourney 537a805
Merge remote-tracking branch 'origin/main' into watches
stevensJourney 577e0d2
updated React Supabase demo
stevensJourney f0fdd23
Add tests for watch with comparator
stevensJourney 07bdba5
remove advanced differentiator from demo.
stevensJourney 155eaea
Improve Query docs. Open up `query.watch` comparator interface.
stevensJourney 7920d37
Remove diff from watched query state for real this time.
stevensJourney 8360d41
Add useWatchedQuerySubscription for Vue package
stevensJourney e758aa6
Improve docs for hooks
stevensJourney 63ec4dd
improve Vue reactivity internals.
stevensJourney 7193b12
more doc cleanup
stevensJourney 169942f
Merge remote-tracking branch 'origin/main' into watches
stevensJourney 053a286
fix test
stevensJourney 9ca66f2
use `comparator` as the option name for hooks. Update `identify` to `…
stevensJourney 4e6dbdb
Merge remote-tracking branch 'origin/main' into watches
stevensJourney c9bcd3f
Merge branch 'main' into watches
stevensJourney 143bb3c
update wording for differential comparator docs
stevensJourney 21cc852
rename default comparator to `DEFAULT_COMPARATOR`
stevensJourney c477a56
preserve compatibility. Hooks should not report `isLoading` if the qu…
stevensJourney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,7 @@ | ||
--- | ||
'@powersync/common': minor | ||
--- | ||
|
||
- Added additional listeners for `closing` and `closed` events in `AbstractPowerSyncDatabase`. | ||
- Added `incrementalWatch` API for enhanced watched queries. | ||
- Added `triggerImmediate` option to the `onChange` API. This allows emitting an initial event which can be useful for downstream use cases. |
This file contains hidden or 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 @@ | ||
--- | ||
'@powersync/vue': minor | ||
--- | ||
|
||
- Added the ability to limit re-renders by specifying a `comparator` for query results. The `useQuery` hook will only emit `data` changes when the data has changed. | ||
|
||
```javascript | ||
useQuery('SELECT * FROM lists WHERE name = ?', ['todo'], { | ||
// This will be used to compare result sets between internal queries | ||
comparator: new ArrayComparator({ | ||
compareBy: (item) => JSON.stringify(item) | ||
}) | ||
}), | ||
``` |
This file contains hidden or 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,6 @@ | ||
--- | ||
'@powersync/react': minor | ||
'@powersync/vue': minor | ||
--- | ||
|
||
- [Internal] Updated implementation to use shared `WatchedQuery` implementation. |
This file contains hidden or 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,5 @@ | ||
--- | ||
'@powersync/web': minor | ||
--- | ||
|
||
Improved query behaviour when client is closed. Pending requests will be aborted, future requests will be rejected with an Error. Fixed read and write lock requests not respecting timeout parameter. |
This file contains hidden or 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 @@ | ||
--- | ||
'@powersync/react': minor | ||
--- | ||
|
||
- Added the ability to limit re-renders by specifying a `comparator` for query results. The `useQuery` hook will only emit `data` changes when the data has changed. | ||
|
||
```javascript | ||
useQuery('SELECT * FROM lists WHERE name = ?', ['todo'], { | ||
// This will be used to compare result sets between internal queries | ||
comparator: new ArrayComparator({ | ||
compareBy: (item) => JSON.stringify(item) | ||
}) | ||
}), | ||
``` |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.