{"id":49149,"library":"redux-storage-decorator-migrate","title":"redux-storage-decorator-migrate","description":"A decorator for redux-storage that adds versioned state migration capabilities. Version 1.1.0 is the latest stable release (last updated 2016). It allows defining migration functions keyed by version number, automatically applied when the stored version differs from the current version. Unlike manual migration checks, this integrates directly with redux-storage's engine pipeline. The package is simple but has no active development and relies on the now-deprecated redux-storage package.","status":"maintenance","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/mathieudutour/redux-storage-decorator-migrate","tags":["javascript","redux","redux-storage","redux-storage-decorator"],"install":[{"cmd":"npm install redux-storage-decorator-migrate","lang":"bash","label":"npm"},{"cmd":"yarn add redux-storage-decorator-migrate","lang":"bash","label":"yarn"},{"cmd":"pnpm add redux-storage-decorator-migrate","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The default export is a function that wraps an engine. Named exports also exist.","wrong":"const { migrate } = require('redux-storage-decorator-migrate')","symbol":"default export","correct":"import migrate from 'redux-storage-decorator-migrate'"},{"note":"buildMigrationEngine is a named export, not default.","wrong":"import buildMigrationEngine from 'redux-storage-decorator-migrate'","symbol":"buildMigrationEngine","correct":"import { buildMigrationEngine } from 'redux-storage-decorator-migrate'"},{"note":"migrate is a function, not a constructor. It returns a decorator engine.","wrong":"const engine = new migrate(engine);","symbol":"migrate function","correct":"const engine = migrate(engine, currentVersion);"}],"quickstart":{"code":"import migrate, { buildMigrationEngine } from 'redux-storage-decorator-migrate';\nimport createEngine from 'redux-storage-engine-localstorage';\n\nconst engine = createEngine('my-app');\nconst version = 3;\nconst decoratedEngine = migrate(engine, version);\n\ndecoratedEngine.addMigration(1, (state) => {\n  // e.g., state.user.name -> state.user.displayName\n  return { ...state, user: { displayName: state.user.name } };\n});\ndecoratedEngine.addMigration(2, (state) => {\n  return { ...state, newFeature: 'initial value' };\n});\ndecoratedEngine.addMigration(3, (state) => {\n  return state; // noop\n});\n\n// Or test a migration in isolation:\nconst testState = { 'redux-storage-decorators-migrate-version': 0, data: 'old' };\nconst migration = { version: 1, migration: (s) => ({ ...s, data: 'new' }) };\nconst migrationEngine = buildMigrationEngine(1, 'version-key', [migration]);\nconst result = migrationEngine(testState);\nconsole.log(result.data); // 'new'","lang":"javascript","description":"Shows how to create a versioned storage engine with migrations and how to test migrations without a store using buildMigrationEngine."},"warnings":[{"fix":"Migrate to redux-persist with its own migration support or use a different state management approach.","message":"This package is designed for redux-storage, which is deprecated in favor of redux-persist.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use buildMigrationEngine(version, versionKey, migrations) to specify a custom key.","message":"The default version key used internally is 'redux-storage-decorators-migrate-version'. Changing it requires using buildMigrationEngine.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure you call migrate() first, then addMigration() in the correct order.","message":"Migrations must be added via addMigration after calling migrate(). Adding them before will have no effect.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider using a more modern alternative like redux-persist with migrations.","message":"Package is not actively maintained; last update in 2016. May have unaddressed vulnerabilities.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.1.0':19 '2016':27 'activ':69 'add':13 'allow':29 'appli':38 'automat':37 'capabl':17 'check':51 'current':46 'decor':4,7,90 'defin':30 'deprec':77 'develop':70 'differ':43 'direct':54 'engin':60 'function':32 'integr':53 'javascript':82 'key':33 'last':25 'latest':22 'manual':49 'migrat':5,16,31,50 'now-deprec':75 'number':36 'packag':63,81 'pipelin':61 'redux':2,10,57,79,83,85,88 'redux-storag':9,56,78,84 'redux-storage-decor':87 'redux-storage-decorator-migr':1 'releas':24 'reli':72 'simpl':65 'stabl':23 'state':15 'storag':3,11,58,80,86,89 'store':41 'unlik':48 'updat':26 'version':14,18,35,42,47","created_at":"2026-06-07T17:00:18.593608+00:00","updated_at":"2026-06-07T17:00:18.593608+00:00","problems":[{"fix":"npm install redux-storage","cause":"The peer dependency redux-storage is not installed.","error":"Cannot find module 'redux-storage'"},{"fix":"Use default import: import migrate from 'redux-storage-decorator-migrate'","cause":"Using a named import where default import is required, or vice versa.","error":"TypeError: migrate is not a function"},{"fix":"First decorate: const decorated = migrate(engine, version); then call decorated.addMigration(...).","cause":"Forgetting to call migrate() on the engine before adding migrations.","error":"Uncaught TypeError: engine.addMigration is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/mathieudutour/redux-storage-decorator-migrate","github":"https://github.com/mathieudutour/redux-storage-decorator-migrate","docs":null,"changelog":null,"pypi":null,"npm":"redux-storage-decorator-migrate","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}