Skip to content
Open
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
220 changes: 220 additions & 0 deletions packages/preact-form/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
# @tanstack/preact-form

## 1.28.3

### Patch Changes

- form arrays now work again ([#2041](https://github.com/TanStack/form/pull/2041))

- Updated dependencies [[`0b3952d`](https://github.com/TanStack/form/commit/0b3952d9805b4f1756829faa012e4112c14859a7)]:
- @tanstack/form-core@1.28.3

## 1.28.2

### Patch Changes

- Updated dependencies [[`a07862d`](https://github.com/TanStack/form/commit/a07862de23ea008c7dd3821edd880b6ebc569016)]:
- @tanstack/form-core@1.28.2

## 1.28.1

### Patch Changes

- Fix compile error with webpack when using react v17 ([#1982](https://github.com/TanStack/form/pull/1982))

- Fix various issues with SSR. Things should now work as-expected in many many more scenarios than before ([#1890](https://github.com/TanStack/form/pull/1890))

- Updated dependencies [[`72d970a`](https://github.com/TanStack/form/commit/72d970add6ab682d733e35a95e5e1f44efb695d2)]:
- @tanstack/form-core@1.28.1

## 1.28.0

### Minor Changes

- add `useTypedAppFormContext` ([#1826](https://github.com/TanStack/form/pull/1826))

### Patch Changes

- fix: flatten errors consistently when validating before field mount ([#2003](https://github.com/TanStack/form/pull/2003))

Fixed an issue where `field.errors` was incorrectly nested as `[[error]]` instead of `[error]` when `form.validate()` was called manually before a field was mounted. The `flat(1)` operation is now applied by default unless `disableErrorFlat` is explicitly set to true, ensuring consistent error structure regardless of when validation occurs.

- Updated dependencies [[`41faffe`](https://github.com/TanStack/form/commit/41faffee657e753b37132275c2255d29fdd3f325), [`7f2453b`](https://github.com/TanStack/form/commit/7f2453baf8c852adfab2475fa3f110f597b24c52)]:
- @tanstack/form-core@1.28.0

## 1.27.7

### Patch Changes

- Updated dependencies [[`3519cce`](https://github.com/TanStack/form/commit/3519cce63072e87989bfa1b83b845e8d645d2725)]:
- @tanstack/form-core@1.27.7

## 1.27.6

### Patch Changes

- Updated dependencies [[`c526378`](https://github.com/TanStack/form/commit/c5263786ed8b12144837ddb87f43c87fa4efc2d4)]:
- @tanstack/form-core@1.27.6

## 1.27.5

### Patch Changes

- Updated dependencies [[`36fa503`](https://github.com/TanStack/form/commit/36fa503f21c59e68138a21de7038bf941a579b55), [`01b24a9`](https://github.com/TanStack/form/commit/01b24a9aa54f7d908830af352cacd51fddf65bbe)]:
- @tanstack/form-core@1.27.5

## 1.27.4

### Patch Changes

- fix(preact-form): prevent array field re-render when child property changes ([#1930](https://github.com/TanStack/form/pull/1930))

Array fields with `mode="array"` were incorrectly re-rendering when a property on any array element was mutated. This was a regression introduced in v1.27.0 by the React Compiler compatibility changes.

The fix ensures that `mode="array"` fields only re-render when the array length changes (items added/removed), not when individual item properties are modified.

Fixes #1925

- Updated dependencies [[`c753d5e`](https://github.com/TanStack/form/commit/c753d5eca5021c231bcdfd5f0a337156958fcde1)]:
- @tanstack/form-core@1.27.4

## 1.27.3

### Patch Changes

- Updated dependencies [[`c2ecf5d`](https://github.com/TanStack/form/commit/c2ecf5d6df0034d2db982f9b55aed963d94a76a3)]:
- @tanstack/form-core@1.27.3

## 1.27.2

### Patch Changes

- use React 18's useId hook by default for formId generation, only calling Math.random() as a fallback if no formId is provided. ([#1913](https://github.com/TanStack/form/pull/1913))

- fix(preact-form): ensure `FormApi.handleSubmit` returns a promise again ([#1924](https://github.com/TanStack/form/pull/1924))

- Updated dependencies []:
- @tanstack/form-core@1.27.2

## 1.27.1

### Patch Changes

- Fix issues with methods not being present in React adapter ([#1903](https://github.com/TanStack/form/pull/1903))

- Updated dependencies [[`3b080ec`](https://github.com/TanStack/form/commit/3b080ec1faefa9894c0f73880dbff680888e6a9a)]:
- @tanstack/form-core@1.27.1

## 1.27.0

### Patch Changes

- Minorly improve performance and fix issues with Start ([#1882](https://github.com/TanStack/form/pull/1882))

- Fixed issues with React Compiler ([#1893](https://github.com/TanStack/form/pull/1893))

- Remove useId for react 17 user compatibility, replaced with uuid ([#1850](https://github.com/TanStack/form/pull/1850))

- Updated dependencies [[`8afbfc3`](https://github.com/TanStack/form/commit/8afbfc39d7373ec2b516f7c8ff5585ca44098cc1), [`4e92a91`](https://github.com/TanStack/form/commit/4e92a913e109f54463be572cdc3f09232e9d2701)]:
- @tanstack/form-core@1.27.0

## 1.26.0

### Patch Changes

- Updated dependencies [[`74f40e7`](https://github.com/TanStack/form/commit/74f40e7d0a862dcb4dbda3481b3a23482883a0a2)]:
- @tanstack/form-core@1.26.0

## 1.25.0

### Minor Changes

- Update Start to Release Candidate version. Extracted start, remix and nextJs adapters to the respective libraries @tanstack/preact-form-start, @tanstack/preact-form-remix, and @tanstack/preact-form-nextjs, ([#1771](https://github.com/TanStack/form/pull/1771))

### Patch Changes

- Updated dependencies [[`004835f`](https://github.com/TanStack/form/commit/004835fbc113f36ac32fc5691ad27bc00813f389)]:
- @tanstack/form-core@1.25.0

## 1.23.9

### Patch Changes

- Updated dependencies [[`8ede6d0`](https://github.com/TanStack/form/commit/8ede6d0bb5615a105f54c13d3160d0243ea6c041)]:
- @tanstack/form-core@1.24.5

## 1.23.8

### Patch Changes

- Allow interfaces to be assigned to `withFieldGroup`'s `props`. ([#1816](https://github.com/TanStack/form/pull/1816))

- Allow returning all other `ReactNode`s not just `JSX.Element` in the `render` function of `withForm` and `withFieldGroup`. ([#1817](https://github.com/TanStack/form/pull/1817))

- form-core: Optimise event client emissions and minor layout tweaks ([#1758](https://github.com/TanStack/form/pull/1758))

- Updated dependencies [[`94631cb`](https://github.com/TanStack/form/commit/94631cb97dea611de69a900c89b7e8dfe0eeee37)]:
- @tanstack/form-core@1.24.4

## 1.23.7

### Patch Changes

- Updated dependencies [[`33cce81`](https://github.com/TanStack/form/commit/33cce812cbfeb42aa7457bab220a807ff5c4ba7f)]:
- @tanstack/form-core@1.24.3: respect dontValidate option in formApi array modifiers ([#1775](https://github.com/TanStack/form/pull/1775))

## 1.23.6

### Patch Changes

- Updated dependencies [[`74af33e`](https://github.com/TanStack/form/commit/74af33eb80218b8cec8642b64ce7e69a62a65248)]:
- @tanstack/form-core@1.24.2: prevent runtime errors when using `deleteField` ([#1706](https://github.com/TanStack/form/pull/1706))

## 1.23.5

### Patch Changes

- Updated dependencies [[`2cfe44c`](https://github.com/TanStack/form/commit/2cfe44ce1e35235ae37ee260dc943a94c9feb71d)]:
- @tanstack/form-core@1.24.1

## 1.23.4

### Patch Changes

- Updated dependencies [[`c978946`](https://github.com/TanStack/form/commit/c97894688c6f5f1953a87c26890e156ecb0bcaab)]:
- @tanstack/form-core@1.24.0

## 1.23.3

### Patch Changes

- Updated dependencies [[`f608267`](https://github.com/TanStack/form/commit/f6082674290a2ec5bc1d3ae33f193539ac7fc4b6)]:
- @tanstack/form-core@1.23.3

## 1.23.2

### Patch Changes

- Updated dependencies [[`7cf3728`](https://github.com/TanStack/form/commit/7cf3728a7b75e077802b427db2a387e36b23682a)]:
- @tanstack/form-core@1.23.2

## 1.23.1

### Patch Changes

- Updated dependencies [[`db96886`](https://github.com/TanStack/form/commit/db96886a8bf9d3d944bf09fc050b4c2c4b514851)]:
- @tanstack/form-core@1.23.1

## 1.23.0

### Patch Changes

- Updated dependencies [[`773c1b8`](https://github.com/TanStack/form/commit/773c1b8d9e1b82b5403633691de22f1a1e188d4f), [`1e36222`](https://github.com/TanStack/form/commit/1e362224d3086f67d8a49839d196edd7aa78c04d)]:
- @tanstack/form-core@1.23.0

## 1.21.1

### Patch Changes

- Updated dependencies [[`d2b6063`](https://github.com/TanStack/form/commit/d2b6063c0fc5406235f8be5462c19497717dfd0d)]:
- @tanstack/form-core@1.22.0
35 changes: 35 additions & 0 deletions packages/preact-form/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<img src="https://static.scarf.sh/a.png?x-pxid=be2d8a11-9712-4c1d-9963-580b2d4fb133" />

![TanStack Form Header](https://github.com/TanStack/form/raw/main/media/repo-header.png)

Hooks for managing form state in Preact

<a href="https://twitter.com/intent/tweet?button_hashtag=TanStack" target="\_parent">
<img alt="#TanStack" src="https://img.shields.io/twitter/url?color=%2308a0e9&label=%23TanStack&style=social&url=https%3A%2F%2Ftwitter.com%2Fintent%2Ftweet%3Fbutton_hashtag%3DTanStack">
</a><a href="https://discord.com/invite/WrRKjPJ" target="\_parent">
<img alt="" src="https://img.shields.io/badge/Discord-TanStack-%235865F2" />
</a><a href="https://github.com/TanStack/form/actions?query=workflow%3A%22preact-form+tests%22">
<img src="https://github.com/TanStack/form/workflows/preact-form%20tests/badge.svg" />
</a><a href="https://www.npmjs.com/package/@tanstack/form-core" target="\_parent">
<img alt="" src="https://img.shields.io/npm/dm/@tanstack/form-core.svg" />
</a><a href="https://bundlephobia.com/package/@tanstack/preact-form@latest" target="\_parent">
<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/preact-form" />
</a><a href="#badge">
<img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a><a href="https://github.com/TanStack/form/discussions">
<img alt="Join the discussion on Github" src="https://img.shields.io/badge/Github%20Discussions%20%26%20Support-Chat%20now!-blue" />
</a><a href="https://bestofjs.org/projects/tanstack-form"><img alt="Best of JS" src="https://img.shields.io/endpoint?url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=TanStack%form%26since=daily" /></a><a href="https://github.com/TanStack/form/" target="\_parent">
<img alt="" src="https://img.shields.io/github/stars/TanStack/form.svg?style=social&label=Star" />
</a><a href="https://twitter.com/tannerlinsley" target="\_parent">
<img alt="" src="https://img.shields.io/twitter/follow/tannerlinsley.svg?style=social&label=Follow" />
</a> <a href="https://gitpod.io/from-referrer/">
<img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"/>
</a>

Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [TanStack Table](https://github.com/TanStack/table), [TanStack Router](https://github.com/tanstack/router), [TanStack Virtual](https://github.com/tanstack/virtual), [React Charts](https://github.com/TanStack/react-charts), [React Ranger](https://github.com/TanStack/ranger)

## Visit [tanstack.com/form](https://tanstack.com/form) for docs, guides, API and more!

### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)

<!-- Use the force, Luke -->
17 changes: 17 additions & 0 deletions packages/preact-form/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-check

import pluginReact from '@eslint-react/eslint-plugin'
import rootConfig from '../../eslint.config.js'

export default [
...rootConfig,
{
files: ['**/*.{ts,tsx}'],
...pluginReact.configs.recommended,
},
{
rules: {
'@eslint-react/no-use-context': 'off',
},
},
]
66 changes: 66 additions & 0 deletions packages/preact-form/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "@tanstack/preact-form",
"version": "1.28.3",
"description": "Powerful, type-safe forms for Preact.",
"author": "tannerlinsley",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/TanStack/form.git",
"directory": "packages/preact-form"
},
"homepage": "https://tanstack.com/form",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"scripts": {
"clean": "premove ./dist ./coverage",
"test:eslint": "eslint ./src ./tests",
"test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"",
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
"test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js",
"test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js",
"test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js",
"test:types:ts58": "tsc",
"test:lib": "vitest",
"test:lib:dev": "pnpm run test:lib --watch",
"test:build": "publint --strict",
"build": "vite build"
},
"type": "module",
"types": "dist/esm/index.d.ts",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
}
},
"./package.json": "./package.json"
},
"sideEffects": false,
"files": [
"dist",
"src"
],
"dependencies": {
"@tanstack/form-core": "workspace:*",
"@tanstack/preact-store": "^0.10.2"
},
"devDependencies": {
"@preact/preset-vite": "^2.10.2",
"@testing-library/preact": "^3.2.4",
"preact": "^10.11.1",
"vite": "^7.2.2"
},
"peerDependencies": {
"preact": ">10.11.0"
}
}
Loading