Skip to content

Commit 985242a

Browse files
committed
plugin: swap to js-yaml for smaller bundle size
1 parent 6dab764 commit 985242a

File tree

3 files changed

+31
-31
lines changed

3 files changed

+31
-31
lines changed

package-lock.json

Lines changed: 27 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@internationalized/date": "3.10.0",
1717
"camelize-ts": "3.0.0",
1818
"classnames": "2.5.1",
19+
"js-yaml": "^4.1.1",
1920
"motion": "12.23.26",
2021
"obsidian": "1.7.2",
2122
"react": "19.2.1",
@@ -24,14 +25,14 @@
2425
"react-textarea-autosize": "8.5.9",
2526
"snakify-ts": "2.3.0",
2627
"tslib": "2.8.1",
27-
"yaml": "2.8.2",
2828
"zod": "4.1.13",
2929
"zustand": "5.0.9"
3030
},
3131
"devDependencies": {
3232
"@rollup/plugin-replace": "6.0.3",
3333
"@testing-library/jest-dom": "6.9.1",
3434
"@testing-library/react": "16.3.0",
35+
"@types/js-yaml": "^4.0.9",
3536
"@types/react-dom": "19.2.1",
3637
"@vitejs/plugin-react": "5.1.2",
3738
"jsdom": "27.3.0",

plugin/src/query/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import YAML from "yaml";
1+
import { load as loadYaml } from "js-yaml";
22
import { z } from "zod";
33

44
import { t } from "@/i18n";
@@ -73,7 +73,7 @@ function tryParseAsJson(raw: string): Record<string, unknown> {
7373

7474
function tryParseAsYaml(raw: string): Record<string, unknown> {
7575
try {
76-
return YAML.parse(raw);
76+
return loadYaml(raw) as Record<string, unknown>;
7777
} catch (e) {
7878
throw new ParsingError(["Invalid YAML"], e);
7979
}

0 commit comments

Comments
 (0)