This package contains shared functionality that is used by other AceBase packages, no need to install manually. See acebase, acebase-client and acebase-server for more information.
All AceBase packages are currently being refactored to TypeScript, allowing them to be transpiled to both ESM and CommonJS modules. This acebase-core
package (v1.15.0+) now contains a distribution for both module systems, but only the CommonJS version is used until all AceBase packages have been migrated to TypeScript. The reason for this is to prevent both distributions of the acebase-core
package to be used at the same time, introducing the so-called "Dual package hazard". Issues might arise if the acebase-core
package is imported by multiple isolated packages, for example if both acebase-client
and acebase
packages are used in a project. They both have a dependency on acebase-core
and depending on their version, both might be using different acebase-core
module distributions.
To prevent possible issues, the CommonJS distribution will be used for both require
and import
statements until all AceBase packages have ESM distributions. If you use acebase-core
in your own project and want to explicitly use the ESM distribution, import from "acebase-core/esm" instead of from "acebase-core".
To check current ESM support for each AceBase package, see the ESM module support discussion on GitHub.
To provide browser support, some source files have a browser-specific counterpart which were previously only specified in the main package.json. Since there are now multiple distributions, the distribution specific browser replacements have been added to the package.json files in the dist/cjs and dist/esm directories: bundlers like Webpack and Browserify use those instead of the ones in the root package.json. Vite (and Rollup?) only seem to use the replacements listed in the root package.json, that's why they still need to be mentioned there as well.