powersync-js
powersync-js copied to clipboard
[Feature] Kysely CommonJs Export
Overview
This adds a CommonJS export for the @powersync/kysely-driver
package. Previously only a ESM export was provided.
React Native typically transpiles import
statements to require
statements, but this might be fickle in some cases - potentially in React Native web.
How this works
See this for reference. The output of this module has changed to:
The cjs export will be used if the module is required e.g. const {} = require('@powersync/kysely-driver')
. The ESM export will be used if the module is imported e.g. import {} from '@powersync/kysely-driver';
The CommonJS export is transpiled via an additional tsconfig.json
file. The contents of this file use require
statements for internal modules. This means this package will require CJS versions of those modules if they provide them. Kysely provides CJS exports.