Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next: fix issue where a derived as attempting to update #185

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chatty-shrimps-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"formsnap": patch
---

fix: issue with derived updating
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
"@huntabyte/eslint-plugin": "^0.1.0",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"eslint": "^9.0.0",
"eslint-plugin-svelte": "^2.44.0",
"eslint-plugin-svelte": "^2.46.0",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.2",
"prettier-plugin-tailwindcss": "0.5.13",
"svelte": "5.0.0-next.260",
"svelte-eslint-parser": "^0.41.1",
"prettier-plugin-svelte": "^3.2.7",
"prettier-plugin-tailwindcss": "0.6.8",
"svelte": "^5.1.4",
"svelte-eslint-parser": "^0.43.0",
"wrangler": "^3.44.0"
},
"type": "module",
Expand Down
16 changes: 8 additions & 8 deletions packages/formsnap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,28 @@
"!dist/**/*.spec.*"
],
"peerDependencies": {
"svelte": "^4.0.0 || ^5.0.0-next.1",
"svelte": "^5.0.0",
"sveltekit-superforms": "^2.19.0"
},
"devDependencies": {
"@sveltejs/kit": "^2.5.28",
"@sveltejs/package": "^2.3.5",
"@sveltejs/vite-plugin-svelte": "4.0.0-next.7",
"@sveltejs/package": "^2.3.7",
"@sveltejs/vite-plugin-svelte": "4.0.0",
"publint": "^0.2.11",
"svelte": "5.0.0-next.260",
"svelte-check": "4.0.3",
"svelte": "^5.0.0",
"svelte-check": "4.0.5",
"sveltekit-superforms": "^2.19.0",
"tailwindcss": "^3.3.6",
"tslib": "^2.7.0",
"tslib": "^2.8.0",
"typescript": "^5.6.2",
"vite": "^5.4.6",
"vite": "^5.4.10",
"vitest": "^2.1.1"
},
"svelte": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"dependencies": {
"svelte-toolbelt": "^0.4.1"
"svelte-toolbelt": "^0.4.4"
},
"engines": {
"pnpm": ">=8.7.0",
Expand Down
4 changes: 0 additions & 4 deletions packages/formsnap/src/app.pcss

This file was deleted.

6 changes: 3 additions & 3 deletions packages/formsnap/src/lib/formsnap.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ class ElementFieldState<T extends Record<string, unknown>, U extends FormPath<T>
: false
);
errorNode = $state<HTMLElement | null>(null);
#descriptionNode = $state<HTMLElement | null>(null);
descriptionNode = $state<HTMLElement | null>(null);
// fall back to the parent field's description node if one for
// this specific element doesn't exist.
descriptionNode = $derived.by(() => {
if (this.#descriptionNode) return this.#descriptionNode;
derivedDescriptionNode = $derived.by(() => {
if (this.descriptionNode) return this.descriptionNode;
if (this.#field.descriptionNode) return this.#field.descriptionNode;
return null;
}) as HTMLElement | null;
Expand Down
5 changes: 0 additions & 5 deletions packages/formsnap/src/routes/+layout.svelte

This file was deleted.

Loading
Loading