-
-
Notifications
You must be signed in to change notification settings - Fork 646
feat(core): Form Devtools #1692
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
028df1c
feat(devtools): implement form devtools
harry-whorlow 8f3bf3b
fix: package lock
harry-whorlow 439cb37
chore: update workflows
harry-whorlow 2f46e96
chore: sherif
harry-whorlow 221aef0
add individual fields
AlemTuzlak a43dfac
Merge pull request #1 from AlemTuzlak/devtools-change
harry-whorlow 10f3ef5
ci: apply automated fixes and generate docs
autofix-ci[bot] 7874be1
feat: add production build
harry-whorlow 11684b5
fix: knipe
harry-whorlow 7290bc0
chore: add to examples
harry-whorlow 0b0ef0d
chore: remove compiler example for now
harry-whorlow 7b4f5fc
chore: add prod react devtools
harry-whorlow cae4288
ci: apply automated fixes and generate docs
autofix-ci[bot] b7ebd69
fix: knip
harry-whorlow 41985c8
fix: failing example bundler
harry-whorlow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json", | ||
| "changelog": [ | ||
| "@svitejs/changesets-changelog-github-compact", | ||
| { "repo": "TanStack/form" } | ||
| ], | ||
| "commit": false, | ||
| "access": "public", | ||
| "baseBranch": "main", | ||
| "updateInternalDependencies": "patch", | ||
| "fixed": [], | ||
| "linked": [], | ||
| "ignore": [] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, alpha, beta, rc] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | ||
|
|
||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| release: | ||
| name: Release | ||
| if: github.repository_owner == 'TanStack' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4.2.2 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Setup Tools | ||
| uses: tanstack/config/.github/setup@main | ||
| - name: Run Tests | ||
| run: pnpm run test:ci | ||
| - name: Run Changesets (version or publish) | ||
| uses: changesets/action@v1.4.9 | ||
| with: | ||
| version: pnpm run changeset:version | ||
| publish: pnpm run changeset:publish | ||
| commit: 'ci: Version Packages' | ||
| title: 'ci: Version Packages' | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,6 @@ coverage: | |
| default: | ||
| target: auto | ||
| threshold: 1% | ||
| ignore: | ||
| - 'packages/form-devtools' | ||
| - 'packages/react-form-devtools' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| --- | ||
| id: devtools | ||
| title: Devtools | ||
| --- | ||
|
|
||
| TanStack Form comes with a ready to go suit of devtools. | ||
|
|
||
| ## Setup | ||
|
|
||
| Install the [TanStack Devtools](https://tanstack.com/devtools/latest/docs/quick-start) library and the [TanStack Form plugin](http://npmjs.com/package/@tanstack/react-form-devtools), from the framework adapter that your working in (in this case `@tanstack/react-devtools`, and `@tanstack/react-form-devtools`). | ||
|
|
||
| ```bash | ||
| npm i @tanstack/react-devtools | ||
| npm i @tanstack/react-form-devtools | ||
| ``` | ||
|
|
||
| Next in the root of your application import the `TanstackDevtools`. | ||
|
|
||
| ```tsx | ||
| import { TanstackDevtools } from '@tanstack/react-devtools' | ||
|
|
||
| import App from './App' | ||
|
|
||
| createRoot(document.getElementById('root')!).render( | ||
| <StrictMode> | ||
| <App /> | ||
|
|
||
| <TanstackDevtools /> | ||
| </StrictMode>, | ||
| ) | ||
| ``` | ||
|
|
||
| Import the `FormDevtoolsPlugin` from **TanStack Form** and provide it to the `TanstackDevtools` component. | ||
|
|
||
| ```tsx | ||
| import { TanstackDevtools } from '@tanstack/react-devtools' | ||
| import { FormDevtoolsPlugin } from '@tanstack/react-form-devtools' | ||
|
|
||
| import App from './App' | ||
|
|
||
| createRoot(document.getElementById('root')!).render( | ||
| <StrictMode> | ||
| <App /> | ||
|
|
||
| <TanstackDevtools plugins={[FormDevtoolsPlugin()]} /> | ||
| </StrictMode>, | ||
| ) | ||
| ``` | ||
|
|
||
| Finally add any additional configuration you desire to the `TanstackDevtools` component, more information can be found under the [TanStack Devtools Configuration](https://tanstack.com/devtools/) section. | ||
|
|
||
| A complete working example can be found in our [examples section](https://tanstack.com/form/latest/docs/framework/react/examples/devtools). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // @ts-check | ||
|
|
||
| /** @type {import('eslint').Linter.Config} */ | ||
| const config = { | ||
| extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'], | ||
| rules: { | ||
| 'react/no-children-prop': 'off', | ||
| }, | ||
| } | ||
|
|
||
| module.exports = config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
|
||
| # dependencies | ||
| /node_modules | ||
| /.pnp | ||
| .pnp.js | ||
|
|
||
| # testing | ||
| /coverage | ||
|
|
||
| # production | ||
| /build | ||
|
|
||
| pnpm-lock.yaml | ||
| yarn.lock | ||
| package-lock.json | ||
|
|
||
| # misc | ||
| .DS_Store | ||
| .env.local | ||
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local | ||
|
|
||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Example | ||
|
|
||
| To run this example: | ||
|
|
||
| - `npm install` | ||
| - `npm run dev` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <link rel="icon" type="image/svg+xml" href="/emblem-light.svg" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <meta name="theme-color" content="#000000" /> | ||
|
|
||
| <title>TanStack Form Devtools Example App</title> | ||
| </head> | ||
| <body> | ||
| <noscript>You need to enable JavaScript to run this app.</noscript> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/index.tsx"></script> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| { | ||
| "name": "@tanstack/form-example-react-devtools", | ||
| "private": true, | ||
| "type": "module", | ||
| "scripts": { | ||
| "dev": "vite --port=3001", | ||
| "build": "vite build", | ||
| "preview": "vite preview", | ||
| "test:types": "tsc" | ||
| }, | ||
| "dependencies": { | ||
| "@tanstack/react-devtools": "^0.6.4", | ||
| "@tanstack/react-form": "^1.20.0", | ||
| "@tanstack/react-form-devtools": "^0.0.1", | ||
| "react": "^19.0.0", | ||
| "react-dom": "^19.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/react": "^19.0.7", | ||
| "@types/react-dom": "^19.0.3", | ||
| "@vitejs/plugin-react": "^4.7.0", | ||
| "vite": "^7.1.5" | ||
| }, | ||
| "browserslist": { | ||
| "production": [ | ||
| ">0.2%", | ||
| "not dead", | ||
| "not op_mini all" | ||
| ], | ||
| "development": [ | ||
| "last 1 chrome version", | ||
| "last 1 firefox version", | ||
| "last 1 safari version" | ||
| ] | ||
| } | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.