Core functionality for AceBase realtime database repositories
Find a file
2022-08-30 20:26:57 +02:00
dist Fix acebase#145 missing types w/Node16 module resn 2022-08-30 20:26:57 +02:00
spec improved once & on code, added unit tests 2022-08-29 11:29:01 +02:00
src improved once & on code, added unit tests 2022-08-29 11:29:01 +02:00
types type improvements 2022-08-15 22:19:11 +02:00
.eslintrc Added eslint and ts plugin 2022-07-18 14:47:19 +02:00
.gitignore Updated readme 2018-09-17 09:29:38 +02:00
.npmignore exclude dev files from npm package 2022-08-29 11:41:48 +02:00
create-package-files Fix acebase#145 missing types w/Node16 module resn 2022-08-30 20:26:57 +02:00
LICENSE Added license file, added repository url in package.json 2018-08-07 11:38:53 +02:00
package.json 1.21.0 2022-08-29 11:43:27 +02:00
README.md updated docs 2022-05-12 12:47:57 +02:00
tsconfig-cjs.json new: commonjs and esmodules distrubitions 2022-04-25 20:17:14 +02:00
tsconfig.json new: commonjs and esmodules distrubitions 2022-04-25 20:17:14 +02:00

AceBase core components

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.

ESM and CJS bundles

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.

Bundler browser replacements

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.