Skip to content

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented Mar 17, 2025

This adds a small example using the Node.JS SDK in the main process of an element application. To expose database functionality, we inject get(), watch() and the status stream into renderer processes using IPC channels created in the preload script.

To exercise the new CommonJS compilation of our Node SDK, the new demo uses webpack to compile everything into a CommonJS module. It also sets up the build to:

  1. Copy the libpowersync.dylib (or the platform-specific alternative name) into the JavaScript assets for the main process.
  2. Creates and starts a custom database worker that loads the native core extensions from their copied location.

Copy link

changeset-bot bot commented Mar 17, 2025

⚠️ No Changeset found

Latest commit: 7dbecbe

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@simolus3 simolus3 marked this pull request as ready for review March 19, 2025 08:19
stevensJourney
stevensJourney previously approved these changes Mar 19, 2025
Base automatically changed from node-commonjs to main March 19, 2025 19:49
@simolus3 simolus3 dismissed stevensJourney’s stale review March 19, 2025 19:49

The base branch was changed.

@simolus3 simolus3 merged commit 7d2a67b into main Mar 24, 2025
6 checks passed
@simolus3 simolus3 deleted the node-electron-sample branch March 24, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants