forked from rhashimoto/wa-sqlite
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Static + Dynamic PowerSync Builds #19
Merged
Merged
Conversation
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 was referenced Nov 7, 2024
Closed
1 task
rkistner
previously approved these changes
Nov 11, 2024
rkistner
reviewed
Nov 11, 2024
rkistner
approved these changes
Nov 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
This supersedes the following PRs:
Update
This PR updates our fork with the latest changes from upstream. Our PowerSync core Git submodule had build issues when just pulling in the latest changes. Build issues have been resolved by removing the use of Git submodules in this repository.
Noteable updates
prepare_v2
fromSQLiteAPI
. Our SDK now has to use a different method forbatchExecute
.1.0.4
. This PR includes amajor
version bump to@journeyapps/[email protected]
PowerSync Core
The PowerSync core is no longer provided from a Git submodule. The
libpowersync-wasm.a
binary is now downloaded from thepowersync-sqlite-core
releases during compilation. The PowerSync core is statically linked in thedist/wa-sqlite.wasm
anddist/wa-sqlite-async.wasm
distributables.The PowerSync specific source has been separated from the SQLite source.
The PowerSync extension can be loaded in the static build with
Dynamic extension loading
See here and here for reference.
We now provide
dist/wa-sqlite-dynamic-main.wasm
anddist/wa-sqlite-async-dynamic-main.wasm
distributables which support dynamic extension loading. These distributables are compiled as Emscripten main modules.The PowerSync side module WASM files are configured to be downloaded in a
postinstall
script.The PowerSync extension can be loaded with:
Runtime errors could occur if the main module does not export all the required symbols which side modules require. We currently don't have a full list of all the common/required symbols for our PowerSync side module. This list could also change if other SQLite extensions are loaded. In order to ensure stability, the main module is currently compiled with the option
MAIN_MODULE=1
. This has the unfortunate affect of a large file-size (3.7mb).