Skip to content

[Wip Alpha] Web Support #56

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

Merged
merged 69 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
6feb22b
Initial extension testing.
rkistner Aug 22, 2023
6d20fae
Replace schema logic with rust extension.
rkistner Aug 23, 2023
1343b48
Use extension for saving operations.
rkistner Aug 23, 2023
eb45c75
Auto tx_id.
rkistner Aug 24, 2023
cc6d08d
Use sync_local op.
rkistner Aug 24, 2023
1ebb56c
Validate checksums using extension.
rkistner Aug 27, 2023
49d1451
clear_remove_ops
rkistner Aug 27, 2023
8e138b5
delete_pending_buckets
rkistner Aug 27, 2023
bb4281c
delete_bucket
rkistner Aug 27, 2023
507ee38
Fix deadlock on closing of connection.
rkistner Sep 4, 2023
15ebc61
WIP.
rkistner Oct 3, 2023
2fd1f79
WIP: seperate web and ffi based imports/exports
stevensJourney Dec 1, 2023
b63aab8
wip
stevensJourney Dec 6, 2023
941f323
wip
stevensJourney Dec 6, 2023
8e5da66
wip
stevensJourney Dec 6, 2023
70f46b4
added abstractions|
stevensJourney Dec 6, 2023
98d000b
added schema update logic without Rust extension implementation
stevensJourney Jan 8, 2024
efca7cd
wip, cleanup imports for web and native
stevensJourney Jan 12, 2024
a7370cf
wip: web abstractions for stream connection.
stevensJourney Jan 16, 2024
c4280a6
initial web version running
stevensJourney Jan 29, 2024
fc30cf7
added update schema
stevensJourney Jan 30, 2024
6dc60cf
wip: update from master
stevensJourney Jan 30, 2024
7c2bc6b
fix merge conflicts
stevensJourney Jan 30, 2024
fb52088
bug fixes for native and tests
stevensJourney Jan 31, 2024
0a9bc4a
fix merge conflicts
stevensJourney Jan 31, 2024
a4fb85a
remove flutter dependencies. Fix native tests.
stevensJourney Feb 1, 2024
a64acef
abstract unit tests per platforms
stevensJourney Feb 2, 2024
541cd01
added web steps for CI tests
stevensJourney Feb 2, 2024
5dfffca
wip: use git repo for sqlite_async
stevensJourney Feb 2, 2024
8fa322c
use https git repo url
stevensJourney Feb 2, 2024
e689d0e
minor bug fixes
stevensJourney Feb 5, 2024
0e13854
minor bug fixes
stevensJourney Feb 5, 2024
1827850
linting fixes
stevensJourney Feb 5, 2024
cbe721f
test on chrome. Temporarily disable problematic tests.
stevensJourney Feb 5, 2024
2499d60
fix typo in CI action
stevensJourney Feb 5, 2024
8f909c5
Failed to fetch on CI test
stevensJourney Feb 5, 2024
18059f3
try single concurrent web test
stevensJourney Feb 5, 2024
343b631
try recreate blobs to fix fetch error
stevensJourney Feb 5, 2024
98e74cb
try ubuntu-xl for CI tests
stevensJourney Feb 5, 2024
61fa47c
test absolute paths
stevensJourney Feb 6, 2024
73652b1
added missing awaits to bucket storage tests
stevensJourney Feb 6, 2024
06d5971
Add missing awaits to bucket storage adapter
stevensJourney Feb 6, 2024
043ab9d
preserve usage in backend connector
stevensJourney Feb 6, 2024
456abca
update attachment helpers and demo apps
stevensJourney Feb 6, 2024
12f0b4a
start moving worker over to shared output
stevensJourney Feb 7, 2024
a793b81
added isolated package to compile Drift webworker. Added repo scripts…
stevensJourney Feb 7, 2024
ba158ba
remove test concurrency limits
stevensJourney Feb 7, 2024
27b605a
update dependencies
stevensJourney Feb 7, 2024
c92f396
update pubspec locks
stevensJourney Feb 8, 2024
0ada003
powersync_web_worker should not be published
stevensJourney Feb 8, 2024
253f12b
cleanup
stevensJourney Feb 8, 2024
4cd883b
add web readme. cleanup code. test specific flutter version
stevensJourney Feb 8, 2024
a304132
update GH actions to use melos prepare script
stevensJourney Feb 8, 2024
c0458b8
update pod files for todolist demo app
stevensJourney Feb 8, 2024
1c502fd
cleanup
stevensJourney Feb 8, 2024
d79dab7
fix full powersync reconnect test
stevensJourney Feb 12, 2024
039e50d
fix tests on web
stevensJourney Feb 12, 2024
25a75f0
cleanup melos file. Update UUID implementation for Web.
stevensJourney Feb 13, 2024
d51c3f8
use native bucket storage for better memory usage
stevensJourney Feb 13, 2024
f432b2d
update dependencies
stevensJourney Feb 13, 2024
34dcf4f
cleanup comments
stevensJourney Feb 13, 2024
7d818be
update Drift worker to fix schema update and table locks after using …
stevensJourney Feb 14, 2024
e890ca4
temporarily bump exit-code-threshold to 10 while sqlite3.dart contain…
stevensJourney Feb 14, 2024
816a415
updated sqlite_async to alpha dependency
stevensJourney Feb 14, 2024
c49f4f7
update from master
stevensJourney Feb 14, 2024
af0ce5c
Fix issue where closing wifi would not close NDJSON stream
stevensJourney Feb 14, 2024
c6ab2cf
pre-emptively bump package versions to alpha to test publish score
stevensJourney Feb 14, 2024
5839d19
less strict package version dependencies
stevensJourney Feb 14, 2024
0e70039
added changelog for powersync_attachments_helper
stevensJourney Feb 14, 2024
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
10 changes: 5 additions & 5 deletions .github/workflows/demos.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Demos checks

concurrency:
group: demos-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
group: demos-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on:
push:
branches:
- "**"
- '**'

jobs:
build:
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Install Melos
run: flutter pub global activate melos
- name: Install dependencies
run: melos bootstrap
run: melos prepare
- name: Check formatting
run: melos format:check:demos
- name: Lint
Expand All @@ -43,6 +43,6 @@ jobs:
- name: Install melos
run: flutter pub global activate melos
- name: Install dependencies
run: melos bootstrap
run: melos prepare
- name: Run tests
run: melos test
13 changes: 7 additions & 6 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Packages check

concurrency:
group: packages-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
group: packages-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on:
push:
branches:
- "**"
- '**'

jobs:
build:
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Install Melos
run: flutter pub global activate melos
- name: Install dependencies
run: melos bootstrap
run: melos prepare
- name: Check formatting
run: melos format:check:packages
- name: Lint
Expand All @@ -46,7 +46,8 @@ jobs:
channel: 'stable'
- name: Install melos
run: flutter pub global activate melos
- name: Install dependencies
run: melos bootstrap
- name: Install dependencies and prepare project
run: melos prepare

- name: Run tests
run: melos test
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
permissions:
contents: write
id-token: write # Required for authentication using OIDC
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/run-pana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ for PACKAGE in "$PACKAGES_DIR"/*; do
cd "$PACKAGE" || exit

# Run the pana command
flutter pub global run pana --no-warning --exit-code-threshold 0
flutter pub global run pana --no-warning --exit-code-threshold 10

# Return to the root directory
cd "$ROOT_DIR" || exit
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
.DS_Store
pubspec_overrides.yaml
.idea
.vscode
*.iml
.flutter-plugins-dependencies
.flutter-plugins
build

# Shared assets
assets

# Web assets
powersync_db.worker.js
sqlite3.wasm
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ This monorepo uses [melos](https://melos.invertase.dev/) to handle command and p

For detailed usage, check out the inner [powersync](https://github.com/powersync-ja/powersync.dart/tree/master/packages/powersync) and [attachments helper](https://github.com/powersync-ja/powersync.dart/tree/master/packages/powersync_attachments_helper) packages.

To configure the monorepo for development run `melos prepare` after cloning

#### Blog posts

- [Flutter Tutorial: building an offline-first chat app with Supabase and PowerSync](https://www.powersync.com/blog/flutter-tutorial-building-an-offline-first-chat-app-with-supabase-and-powersync)
Expand Down
3 changes: 2 additions & 1 deletion demos/supabase-anonymous-auth/lib/powersync.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file performs setup of the PowerSync database
import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:logging/logging.dart';
import 'package:path/path.dart';
import 'package:path_provider/path_provider.dart';
Expand Down Expand Up @@ -136,7 +137,7 @@ String? getUserId() {
}

Future<String> getDatabasePath() async {
final dir = await getApplicationSupportDirectory();
final dir = kIsWeb ? Directory('/') : await getApplicationSupportDirectory();
return join(dir.path, 'powersync-demo.db');
}

Expand Down
Loading