From a58b4c33368f2d0ef39c2aba1a45498f4065c7b5 Mon Sep 17 00:00:00 2001 From: Jos de Jong Date: Wed, 6 Jul 2022 10:47:53 +0200 Subject: [PATCH] feat: state refactor (#111) BREAKING CHANGES: - The type `JSONPath` is changed from `Array` to `Array` - Some TypeScript types now come from `immutable-json-patch` All changes: - Refactor state from relying on a nested structure and Symbols into a solution that is lazy and uses a flat map with pointers. The new state is easier to understand and maintain. - Create and use helper functions like `createValueSelection` to create selections, and use type guards like `isValueSelection` everywhere to simplify the code. - Refactor `JSONPath` from having numeric indexes to having them as string (better compatible with `JSONPointer`, and less error-prone). - Use more TypeScript types from `immutable-json-patch` - Refactor and simplify the dragging logic - Fix issues related to selection being updated after patch instead of in one go - Refactor more code to TypeScript - Add unit tests - Performance is comparable to what it was --- CHANGELOG.md | 1 + package.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8e4b808..b2c47c3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog + All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. ### [0.3.60](https://github.com/josdejong/svelte-jsoneditor/compare/v0.3.59...v0.3.60) (2022-06-09) diff --git a/package.json b/package.json index a302d8ef..2681017e 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ "lint:eslint": "eslint --cache --ignore-path .gitignore .", "format": "prettier --write --plugin-search-dir=. .", "prepare": "husky install && cd tools && node generateDiffSequenceEsm.js && cd ..", - "release": "npm run lint && npm test && standard-version && npm run package && git push && git push --tag && npm publish package/" + "release": "npm run lint && npm test && standard-version && npm run package && git push && git push --tag && npm publish package/", + "dry-run": "standard-version --dry-run" }, "dependencies": { "@codemirror/commands": "^6.0.1",