Skip to content

Releases: azu/kvs

v2.2.0

26 Jan 22:10
@azu azu
b7d5841
Compare
Choose a tag to compare

What's Changed

Features

New Contributors

Full Changelog: v2.1.5...v2.2.0

v2.1.5

21 Jul 12:20
@azu azu
bd85ca1
Compare
Choose a tag to compare

What's Changed

Refactoring

  • refactor(node-localstorage): use native fs by @azu in #44

reduce install size

Full Changelog: v2.1.4...v2.1.5

v2.1.4

21 Jul 12:02
@azu azu
d7a5ac9
Compare
Choose a tag to compare

What's Changed

Documentation

Refactoring

  • refactor: update dependencies by @azu in #42

Testing

  • test: move karma to playwright-test by @azu in #41

New Contributors

Full Changelog: v2.1.3...v2.1.4

v2.1.3

25 Sep 05:31
@azu azu
85b5649
Compare
Choose a tag to compare

2.1.3 (2022-09-25)

Bug Fixes

v2.1.2

21 Aug 03:39
@azu azu
Compare
Choose a tag to compare

2.1.2 (2022-08-21)

Bug Fixes

  • kvs/env: module entry point to browser (b8529ad)

v2.1.1

03 Mar 04:40
@azu azu
Compare
Choose a tag to compare

v2.1.0

02 Mar 13:39
@azu azu
Compare
Choose a tag to compare

2.1.0 (2022-03-02)

Bug Fixes

  • indexeddb: remove "debug" option (#25) (606b9a2)

Performance Improvements

It aim to reduce file size.

Path Size
packages/env/module/browser.js 1.06 KB (-22.84% 🔽)
packages/indexeddb/module/index.js 1.05 KB (-22.06% 🔽)
packages/localstorage/module/index.js 853 B (-27.04% 🔽)

This library require AsyncIterator support from the beginning.
It means that it require ES2018+ support.

v2.0.0

19 Feb 01:55
@azu azu
Compare
Choose a tag to compare

2.0.0 (2022-02-19)

Bug Fixes

BREAKING CHANGES

  • storage: storage package sperate storags by name option

Previously, @kvs/storage does not separate key per storage.
This issue cause iteration error like #20

However, It need to change saving storage's key for fixing the issue.
We need to bump it as major update.

Affected Packages

  • @kvs/env in Node.js
    • 📝 Browser is not affected because it uses IndexedDB
  • @kvs/storage
  • @kvs/localstorage
  • @kvs/memorystorage
  • @kvs/node-localstorage
  • @kvs/storage-sync

Previous: storage save value with key

key: value

This PR: storage save value with ${name}.__.${key}.

${name}.__.${key}: value

It means that kvs package can not load value which is saved by previous version.

Migration

You need to write manuall migration code using upgrade.

If you have used @kvs/localstorage, you can write following.
Unfortunately, this migration should use raw localStorage API because @kvs/localstorage can not access the key which is created in kvs 1.x.

import { kvsLocalStorage } from "@kvs/localstorage";
type StorageSchema = {
    a1: string;
    b2: number;
    c3: boolean;
};
const databaseName = "kvs-database";
const storage = kvsStorageSync<StorageSchema>({
    name: databaseName,
    version: 2, // If previous `version` is 1, you need to update the version to 2
    storage: localStorage,
    upgrade({ oldVersion }: { kvs: KVSSync<StorageSchema>; oldVersion: number; newVersion: number }): any {
        if (oldVersion < 2) {
            // manually migration to new key format
            ["a1", "b2", "c3"].forEach((key) => {
                // CAUTION: use raw localStorage for migration
                const item = localStorage.getItem(key);
                if (item) {
                    localStorage.setItem(`${databaseName}.__.${key}`, item);
                }
            });
        }
    }
});
KVS raw localStorage
@kvs/localstorage localStorage API
@kvs/memorystorage NONE
@kvs/node-localstorage node-localstorage package
@kvs/env in Node.js node-localstorage package

v1.2.0

17 Apr 06:35
@azu azu
Compare
Choose a tag to compare

for TypeScript User

1.2.0 require TS 4.1+ because it use Key Remapping in Mapped Types.

Features

  • support index signature in SchemaTypes
(async () => {
    type Scheme = {
        [index:string]: string;
    };
    const storage = await kvsEnvStorage<Scheme>({
        name: "test-data",
        version: 1,
    });
    const value = await storage.set("key", "value");
})();

v1.1.0

29 Oct 01:57
@azu azu
Compare
Choose a tag to compare

1.1.0 (2020-10-29)

Features