Upgrade to v1
Learn how to upgrade SignalDB in your project to version 1.0.0. This guide provides step-by-step instructions and best practices for a smooth upgrade process.
Switch to new packages
The core, the reactivity adapters & integration packages have been renamed and moved to the @signaldb scope. If your application is using any of them, you need to install the new packages and update your imports.
First of all, uninstall all old packages by running the following command.
npm uninstall -S signaldb \
signaldb-plugin-angular \
signaldb-plugin-maverickjs \
signaldb-plugin-meteor \
signaldb-plugin-mobx \
signaldb-plugin-oby \
signaldb-plugin-preact \
signaldb-plugin-reactively \
signaldb-plugin-sinuous \
signaldb-plugin-sjs \
signaldb-plugin-solid \
signaldb-plugin-usignal \
signaldb-plugin-vueCore Packages
The core package has been renamed to @signaldb/core and the SyncManager has been moved to @signaldb/sync. You need to install the new packages and update your imports. @signaldb/sync is only needed if you're using the sync engine.
npm install @signaldb/core @signaldb/syncimport { Collection, … } from '@signaldb/core'
import { SyncManager } from '@signaldb/sync'createLocalStorageAdapter
The createLocalStorageAdapter function has been moved to the @signaldb/localstorage package. If your application is using it, you need to install the new package and update your imports.
npm install @signaldb/localstorageimport createLocalStorageAdapter from '@signaldb/localstorage'createOPFSAdapter
The createOPFSAdapter function has been moved to the @signaldb/opfs package. If your application is using it, you need to install the new package and update your imports.
npm install @signaldb/opfsimport createOPFSAdapter from '@signaldb/opfs'createFileSystemAdapter
The createFileSystemAdapter function has been moved to the @signaldb/fs package. If your application is using it, you need to install the new package and update your imports.
npm install @signaldb/fsimport createFileSystemAdapter from '@signaldb/fs'React
The React integration package has been renamed to @signaldb/react. If you're using it, you need to install the new package and update your imports.
npm install @signaldb/reactimport createUseReactivityHook from '@signaldb/react'Angular
The Angular reactivity adapter has been renamed to @signaldb/angular. If you're using it, you need to install the new package and update your imports.
npm install @signaldb/angularimport angularReactivityAdapter from '@signaldb/angular'@maverickjs/signals
The @maverickjs/signals reactivity adapter has been renamed to @signaldb/maverickjs. If you're using it, you need to install the new package and update your imports.
npm install @signaldb/maverickjsimport maverickjsReactivityAdapter from '@signaldb/maverickjs'Meteor Tracker
The Meteor Tracker reactivity adapter has been renamed to @signaldb/meteor. If you're using it, you need to install the new package and update your imports.
npm install @signaldb/meteorimport meteorReactivityAdapter from '@signaldb/meteor'MobX
The MobX reactivity adapter has been renamed to @signaldb/mobx. If you're using it, you need to install the new package and update your imports.
npm install @signaldb/mobximport mobxReactivityAdapter from '@signaldb/mobx'oby
The oby reactivity adapter has been renamed to @signaldb/oby. If you're using it, you need to install the new package and update your imports.
npm install @signaldb/obyimport obyReactivityAdapter from '@signaldb/oby'@preact/signals
The @preact/signals reactivity adapter has been renamed to @signaldb/preact. If you're using it, you need to install the new package and update your imports.
npm install @signaldb/preactimport preactReactivityAdapter from '@signaldb/preact'@reactively/core
The @reactively/core reactivity adapter has been renamed to @signaldb/reactively. If you're using it, you need to install the new package and update your imports.
npm install @signaldb/reactivelyimport reactivelyReactivityAdapter from '@signaldb/reactively'sinuous
The sinuous reactivity adapter has been renamed to @signaldb/sinuous. If you're using it, you need to install the new package and update your imports.
npm install @signaldb/sinuousimport sinuousReactivityAdapter from '@signaldb/sinuous'S.js
The S.js reactivity adapter has been renamed to @signaldb/sjs. If you're using it, you need to install the new package and update your imports.
npm install @signaldb/sjsimport sjsReactivityAdapter from '@signaldb/sjs'solid
The solid reactivity adapter has been renamed to @signaldb/solid. If you're using it, you need to install the new package and update your imports.
npm install @signaldb/solidimport solidReactivityAdapter from '@signaldb/solid'usignal
The usignal reactivity adapter has been renamed to @signaldb/usignal. If you're using it, you need to install the new package and update your imports.
npm install @signaldb/usignalimport usignalReactivityAdapter from '@signaldb/usignal'vue
The vue reactivity adapter has been renamed to @signaldb/vue. If you're using it, you need to install the new package and update your imports.
npm install @signaldb/vueimport vueReactivityAdapter from '@signaldb/vue'Remove usage of PersistentCollection
The PersistentCollection class has been removed. If your application is using it, you need to switch to the default Collection and use adapters to persist data.
To adapt the old logic, you can do something like this.
import { Collection } from '@signaldb/core'
import createLocalStorageAdapter from '@signaldb/localstorage'
import createFileSystemAdapter from '@signaldb/fs'
const someCollection = new Collection({
persistence: typeof window === 'undefined'
? createFileSystemAdapter({ path: './persistent-collection-someCollection.json' })
: createLocalStorageAdapter({ key: 'someCollection' }),
})Switch from ReplicatedCollection to SyncManager
The ReplicatedCollection class has been removed. If your application is using it, you need to switch to the SyncManager class. Since the SyncManager uses a totally different approach, you need to update your code.
Take a look at the SyncManager documentation to see how to use it.
Remove options parameter from combinePersistenceAdapters
The combinePersistenceAdapters function no longer accepts an options parameter. If your application is using it, you need to remove it. The options had allowed to switch the sequence of the arguemnts, but this is no longer necessary. The first argument is the primary adapter and the second argument is the secondary adapter.
Switch to new IndexProviders
Support for old custom IndexProviders has been removed. If your application is using them, you need to switch to the new ones. This is only necessary if you are using custom IndexProviders. If you are using the createIndex function, you don't need to do anything.
Further help
If you need further help, please start a discussion on Github, join our Discord server or open an issue.