Skip to content

[Wip Alpha] Web Support #61

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 62 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
57e5be3
[Wip Alpha] Web Support (#56)
stevensJourney Feb 14, 2024
44a466f
updated from master
stevensJourney Feb 14, 2024
c67c12a
use Dart script instead of sh script for wasm init
stevensJourney Feb 15, 2024
a32302a
update readme with instructions for fetching powersync_db.worker.js
stevensJourney Feb 15, 2024
92896fe
update PowerSyncDatabase init examples for web
stevensJourney Feb 15, 2024
83f0608
fix lint
stevensJourney Feb 15, 2024
92d7390
improve pana analyzing to only scan published packages
stevensJourney Feb 15, 2024
302e5ee
optimize webworker filesize
stevensJourney Feb 15, 2024
5c3947f
added automated webworker release action
stevensJourney Feb 15, 2024
bdee9cc
Add testing instructions to Readme
benitav Feb 15, 2024
f865bf5
Restore Flutter examples in Readme.
benitav Feb 15, 2024
16808f3
Typo
benitav Feb 15, 2024
8f793d3
neaten up release action
stevensJourney Feb 15, 2024
d5abe24
More helpful information
benitav Feb 15, 2024
b9bce8c
Version improvement
benitav Feb 15, 2024
b1adb63
use better action for automated releases
stevensJourney Feb 15, 2024
93c8b06
chore(release): publish packages
stevensJourney Feb 15, 2024
d73b322
correct powersync tags for release trigger
stevensJourney Feb 15, 2024
32755dc
give release action the tag it wants
stevensJourney Feb 15, 2024
b91d2b6
Merge pull request #62 from powersync-ja/web-alpha-2
stevensJourney Feb 15, 2024
56b814e
update sqlite_async.dart. Fix disconnectAndClear on web.
stevensJourney Mar 5, 2024
5efb6ab
updated from master
stevensJourney Mar 5, 2024
16ada17
added tests for disconnectAndClear
stevensJourney Mar 5, 2024
b2410d1
lint
stevensJourney Mar 5, 2024
074c44f
remove copied comment
stevensJourney Mar 5, 2024
f06277b
use named parameter for abort controller in sync stream
stevensJourney Mar 5, 2024
c7e646b
chore(release): publish packages
stevensJourney Mar 5, 2024
c894b34
Merge pull request #66 from powersync-ja/alpha-fix-disconnect-and-clear
stevensJourney Mar 5, 2024
ffe4bd8
chore: merge master in web alpha (#73)
DominicGBauer Apr 17, 2024
0bb04bc
chore: update version (#77)
DominicGBauer Apr 18, 2024
422f178
update from main
stevensJourney May 29, 2024
87e7c4e
fix tests
stevensJourney May 29, 2024
7a7c0a3
fix tests
stevensJourney May 29, 2024
8d00dd6
revert test package version
stevensJourney May 29, 2024
decbdcb
Revert "revert test package version"
stevensJourney May 29, 2024
ea99fb3
fix tests
stevensJourney May 29, 2024
02b96a6
update reconnect test
stevensJourney May 29, 2024
7c0ae77
fix issues where Sync stream manager's mutex would not release
stevensJourney May 30, 2024
a8bfafb
update dependencies
stevensJourney May 30, 2024
2070ea6
Merge branch 'master' into alpha-main
stevensJourney May 30, 2024
6b8ed50
cleanup
stevensJourney May 30, 2024
ec49cb5
update dependencies
stevensJourney May 30, 2024
7347e9a
update sqlite versions
stevensJourney May 30, 2024
c2b68a3
Merge branch 'master' into alpha-main
stevensJourney May 30, 2024
a5c929f
update lockfiles after testing
stevensJourney May 30, 2024
ac09108
better version ranges
stevensJourney May 30, 2024
d3ddb12
restore dcli
stevensJourney May 30, 2024
5038f31
Merge pull request #87 from powersync-ja/alpha-main
stevensJourney May 30, 2024
c402e88
update sqlite_async.dart. Remove streaming from sync request body.
stevensJourney May 30, 2024
9baa9f8
chore(release): publish packages
stevensJourney May 30, 2024
182aa15
remove duplicate changelog
stevensJourney May 30, 2024
0e03710
Merge pull request #90 from powersync-ja/fix/streaming-requests
stevensJourney May 30, 2024
c3d105b
Prevent completing futures twice for web (#104)
mugikhan Jun 24, 2024
106c85b
[Feature] Use Sqlite Async New SQLIte libs (#93)
stevensJourney Jul 1, 2024
a2556ce
Bump version and changelog message (#111)
mugikhan Jul 1, 2024
cdb6b48
[Chore] Update Sqlite Async Web (#118)
stevensJourney Jul 4, 2024
ecc9c22
[Feature] Implement web sync locks (#119)
stevensJourney Jul 10, 2024
4a6fe88
Merge master into alpha release (#122)
mugikhan Jul 17, 2024
d2b8eeb
Update powersync dependency to version 1.3.0-alpha.10 (#125)
mugikhan Jul 18, 2024
0919586
Merge branch 'master' into chore/merge-master-alpha-release-2
mugikhan Jul 25, 2024
c289e8d
Fix tests
mugikhan Jul 25, 2024
38f9ff3
Merge pull request #127 from powersync-ja/chore/merge-master-alpha-re…
mugikhan Jul 25, 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
13 changes: 5 additions & 8 deletions .github/workflows/demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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,11 +43,8 @@ jobs:
- name: Install melos
run: flutter pub global activate melos
- name: Install dependencies
run: melos bootstrap
- name: Download powersync binary
run: |
github="https://github.com/powersync-ja/powersync-sqlite-core/releases/download/v0.1.6"

curl "${github}/libpowersync_x64.so" -o packages/powersync/libpowersync.so --create-dirs -L -f
- name: Run tests
run: melos prepare
- name: Run flutter tests
run: melos test
- name: Run dart tests
run: melos test:web
17 changes: 7 additions & 10 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@ -33,7 +33,7 @@ jobs:
- name: Check publish score
run: |
flutter pub global activate pana
./.github/workflows/scripts/run-pana.sh
melos analyze:packages:pana --no-select

test:
runs-on: ubuntu-latest
Expand All @@ -46,12 +46,9 @@ jobs:
channel: "stable"
- name: Install melos
run: flutter pub global activate melos
- name: Install dependencies
run: melos bootstrap
- name: Download powersync binary
run: |
github="https://github.com/powersync-ja/powersync-sqlite-core/releases/download/v0.1.6"

curl "${github}/libpowersync_x64.so" -o packages/powersync/libpowersync.so --create-dirs -L -f
- name: Run tests
- name: Install dependencies and prepare project
run: melos prepare
- name: Run flutter tests
run: melos test
- name: Run dart tests
run: melos test:web
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
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This triggers whenever a tagged release is pushed
name: Compile Assets and Create Draft Release

on:
push:
tags:
# Trigger on tags beginning with 'v'
# Note that `melos version ...` adds the package name as a suffix
# This action is not compatible with tags such as `powersync-v1.1.1`
# marvinpinto/action-automatic-releases struggles to generate changelogs
# Be sure to manually tag the commit to trigger this action
- 'v*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
channel: 'stable'

- name: Install Melos
run: flutter pub global activate melos

- name: Install Dependencies and Compile Assets
run: melos prepare

- name: Create Draft Release
uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
prerelease: true # TODO update when out of alpha
draft: true
files: |
assets/powersync_db.worker.js
25 changes: 0 additions & 25 deletions .github/workflows/scripts/run-pana.sh

This file was deleted.

14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
.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

#Core binaries
*.dylib
*.dll
*.so
168 changes: 162 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,186 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2024-07-16
## 2024-07-18

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.
- There are no breaking changes in this release.

Packages with other changes:

- [`powersync` - `v1.5.5`](#powersync---v155)
- [`powersync_attachments_helper` - `v0.5.1+1`](#powersync_attachments_helper---v0511)
- [`powersync` - `v1.6.0-alpha.1`](#powersync---v160-alpha1)
- [`powersync_attachments_helper` - `v0.6.0-alpha.1`](#powersync_attachments_helper---v060-alpha1)

Packages with dependency updates only:

> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.

- `powersync_attachments_helper` - `v0.5.1+1`
- `powersync_attachments_helper` - `v0.6.0-alpha.1`

---

#### `powersync` - `v1.6.0-alpha.1`

- Added support for client parameters when connecting.
- Fix watch query parameter `triggerOnTables` to prepend powersync view names.
- Upgrade dependency `sqlite_async` to version 0.8.1.
- Fix issue where `hasSynced` is cleared when offline.

## 2024-07-16

### Changes

---

- [`powersync` - `v1.5.5`](#powersync---v155)
- [`powersync_attachments_helper` - `v0.5.1+1`](#powersync_attachments_helper---v0511)

#### `powersync` - `v1.5.5`

- Fix issue where `hasSynced` is cleared when offline.
- Fix issue where `hasSynced` is cleared when offline.

## 2024-07-10

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`powersync` - `v1.3.0-alpha.9`](#powersync---v130-alpha9)
- [`powersync_attachments_helper` - `v0.3.0-alpha.4`](#powersync_attachments_helper---v030-alpha4)

Packages with dependency updates only:

> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.

- `powersync_attachments_helper` - `v0.3.0-alpha.4`

---

#### `powersync` - `v1.3.0-alpha.9`

- Updated sqlite_async to use Navigator locks for limiting sync stream implementions in multiple tabs

## 2024-07-04

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`powersync` - `v1.3.0-alpha.8`](#powersync---v130-alpha8)
- [`powersync_attachments_helper` - `v0.3.0-alpha.3`](#powersync_attachments_helper---v030-alpha3)

Packages with dependency updates only:

> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.

- `powersync_attachments_helper` - `v0.3.0-alpha.3`

---

#### `powersync` - `v1.3.0-alpha.8`

- **FIX**(powersync-attachements-helper): pubspec file (#29).
- **DOCS**: update readme and getting started (#51).

## 2024-05-30

### Changes

---

Packages with breaking changes:

- [`powersync_attachments_helper` - `v0.3.0-alpha.2`](#powersync_attachments_helper---v030-alpha2)

Packages with other changes:

- [`powersync` - `v1.3.0-alpha.5`](#powersync---v130-alpha5)

---

#### `powersync_attachments_helper` - `v0.3.0-alpha.2`

- **FIX**: reset isProcessing when exception is thrown during sync process. (#81).
- **FIX**: attachment queue duplicating requests (#68).
- **FIX**(powersync-attachements-helper): pubspec file (#29).
- **FEAT**(attachments): add error handlers (#65).
- **DOCS**: update readmes (#38).
- **BREAKING** **FEAT**(attachments): cater for subdirectories in storage (#78).

#### `powersync` - `v1.3.0-alpha.5`

- **FIX**(powersync-attachements-helper): pubspec file (#29).
- **DOCS**: update readme and getting started (#51).

## 2024-03-05

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`powersync` - `v1.3.0-alpha.3`](#powersync---v130-alpha3)
- [`powersync_attachments_helper` - `v0.3.0-alpha.2`](#powersync_attachments_helper---v030-alpha2)

Packages with dependency updates only:

> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.

- `powersync_attachments_helper` - `v0.3.0-alpha.2`

---

#### `powersync` - `v1.3.0-alpha.3`

- Fixed issue where disconnectAndClear would prevent subsequent sync connection on native platforms and would fail to clear the database on web.

## 2024-02-15

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`powersync` - `v1.3.0-alpha.2`](#powersync---v130-alpha2)
- [`powersync_attachments_helper` - `v0.3.0-alpha.2`](#powersync_attachments_helper---v030-alpha2)

Packages with dependency updates only:

> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.

- `powersync_attachments_helper` - `v0.3.0-alpha.2`

---

#### `powersync` - `v1.3.0-alpha.2`

- **FIX**(powersync-attachements-helper): pubspec file (#29).
- **DOCS**: update readme and getting started (#51).
- `powersync_attachments_helper` - `v0.5.1+1`
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
2 changes: 1 addition & 1 deletion demos/django-todolist/lib/models/todo_item.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:powersync_django_todolist_demo/models/schema.dart';

import '../powersync.dart';
import 'package:powersync/sqlite3.dart' as sqlite;
import 'package:powersync/sqlite3_common.dart' as sqlite;

/// TodoItem represents a result row of a query on "todos".
///
Expand Down
2 changes: 1 addition & 1 deletion demos/django-todolist/lib/models/todo_list.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:powersync/sqlite3.dart' as sqlite;
import 'package:powersync/sqlite3_common.dart' as sqlite;

import './todo_item.dart';
import '../powersync.dart';
Expand Down
2 changes: 1 addition & 1 deletion demos/django-todolist/lib/widgets/query_widget.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:powersync/sqlite3.dart' as sqlite;
import 'package:powersync/sqlite3_common.dart' as sqlite;

import './resultset_table.dart';
import '../powersync.dart';
Expand Down
2 changes: 1 addition & 1 deletion demos/django-todolist/lib/widgets/resultset_table.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:powersync/sqlite3.dart' as sqlite;
import 'package:powersync/sqlite3_common.dart' as sqlite;

/// Stateless DataTable rendering results from a SQLite query
class ResultSetTable extends StatelessWidget {
Expand Down
Loading
Loading