Skip to content

Commit 2fa725b

Browse files
Update changeset
1 parent c1cf8bc commit 2fa725b

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.changeset/seven-fireants-boil.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,28 @@
22
'@powersync/node': minor
33
---
44

5-
Pre-package all the PowerSync Rust extension binaries for all supported platforms in the NPM package. Install scripts are no longer required to download the PowerSync core.
5+
Pre-package all the PowerSync Rust extension binaries for all supported platforms and architectures in the NPM package `lib` folder. Install scripts are no longer required to download the PowerSync core.
6+
7+
The binary files relevant to a specific architecture now have updated filenames. Custom code which previously referenced binary filenames requires updating. A helper function is available to automatically provide the correct filename.
8+
9+
```diff
10+
+ import { getPowerSyncExtensionFilename } from '@powersync/node/worker.js';
11+
12+
function resolvePowerSyncCoreExtension() {
13+
- const platform = OS.platform();
14+
- let extensionPath: string;
15+
- if (platform === 'win32') {
16+
- extensionPath = 'powersync.dll';
17+
- } else if (platform === 'linux') {
18+
- extensionPath = 'libpowersync.so';
19+
- } else if (platform === 'darwin') {
20+
- extensionPath = 'libpowersync.dylib';
21+
- } else {
22+
- throw 'Unknown platform, PowerSync for Node.js currently supports Windows, Linux and macOS.';
23+
- }
24+
+ const extensionPath = getPowerSyncExtensionFilename();
25+
26+
// This example uses copy-webpack-plugin to copy the prebuilt library over. This ensures that it is
27+
// available in packaged release builds.
28+
let libraryPath = path.resolve(__dirname, 'powersync', extensionPath);
29+
```

0 commit comments

Comments
 (0)