Skip to content

[Solid.js] feat: add withForm and createAppForm APIs #1453

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

crutchcorn
Copy link
Member

TODOs

  • Write docs
  • Receive code review from community to validate if useFieldContext should return a signal or stay as-is

Copy link

nx-cloud bot commented Apr 25, 2025

View your CI Pipeline Execution ↗ for commit 1a851ee.

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 43s View ↗
nx run-many --target=build --exclude=examples/** ✅ Succeeded 7s View ↗

☁️ Nx Cloud last updated this comment at 2025-04-25 10:27:30 UTC

Copy link

pkg-pr-new bot commented Apr 25, 2025

More templates

@tanstack/angular-form

npm i https://pkg.pr.new/@tanstack/angular-form@1453

@tanstack/form-core

npm i https://pkg.pr.new/@tanstack/form-core@1453

@tanstack/react-form

npm i https://pkg.pr.new/@tanstack/react-form@1453

@tanstack/lit-form

npm i https://pkg.pr.new/@tanstack/lit-form@1453

@tanstack/svelte-form

npm i https://pkg.pr.new/@tanstack/svelte-form@1453

@tanstack/vue-form

npm i https://pkg.pr.new/@tanstack/vue-form@1453

@tanstack/solid-form

npm i https://pkg.pr.new/@tanstack/solid-form@1453

commit: 1a851ee

Copy link

codecov bot commented Apr 25, 2025

Codecov Report

Attention: Patch coverage is 93.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 93.15%. Comparing base (daf8e57) to head (1a851ee).

Files with missing lines Patch % Lines
packages/solid-form/src/makeFormCreate.tsx 93.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1453      +/-   ##
==========================================
+ Coverage   88.83%   93.15%   +4.31%     
==========================================
  Files          31        3      -28     
  Lines        1379       73    -1306     
  Branches      347        4     -343     
==========================================
- Hits         1225       68    -1157     
+ Misses        137        5     -132     
+ Partials       17        0      -17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@crutchcorn crutchcorn changed the title feat: add withForm and createAppForm APIs [Solid.js] feat: add withForm and createAppForm APIs Apr 25, 2025
}) as Component<ParentProps>

const AppField = ((props) => {
const { children, ...rest } = props
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.solidjs.com/reference/reactive-utilities/split-props
Use this instead. children is a function so it would be an edge case for someone to do reactive() ? () => Comp1 : () => Comp2 but still.

TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>,
TSubmitMeta,
TRenderProps extends Record<string, unknown> = {},
>({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would avoid destructure here in case the user wants to make them reactive too. The deeper reactivity within props and render are maintained so idk if we want to even enable that pattern.

const TFormComponents extends Record<string, Component<any>>,
>({
fieldComponents,
fieldContext,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with the destructures here, I would avoid them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants