Skip to content

feat(solid-form): add createFormHook for solid-js. #1597

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 8 commits into
base: main
Choose a base branch
from

Conversation

MAST1999
Copy link
Contributor

I was starting a new project and decided to use solid, and I found out that createHookForm was missing so here I am 😄

I don't have too much experience with solid, but I think this looks good.

Copy link

nx-cloud bot commented Jun 29, 2025

View your CI Pipeline Execution ↗ for commit c1f9dd8

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ❌ Failed 1m 18s View ↗
nx run-many --target=build --exclude=examples/** ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-07-06 05:24:53 UTC

@MAST1999
Copy link
Contributor Author

Will start the work on docs after getting the green light on the PR.

Copy link

pkg-pr-new bot commented Jun 29, 2025

Copy link

codecov bot commented Jun 29, 2025

Codecov Report

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

Project coverage is 93.50%. Comparing base (4abbc8a) to head (7ff1cc5).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
packages/solid-form/src/createFormHook.tsx 94.11% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1597      +/-   ##
==========================================
+ Coverage   89.24%   93.50%   +4.26%     
==========================================
  Files          31        3      -28     
  Lines        1432       77    -1355     
  Branches      366        4     -362     
==========================================
- Hits         1278       72    -1206     
+ 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.

@LeCarbonator
Copy link
Contributor

The feature's already in the works over at #1453 . Would you mind taking a look at it and giving feedback?

@MAST1999
Copy link
Contributor Author

The feature's already in the works over at #1453 . Would you mind taking a look at it and giving feedback?

Looks like it has the same changes I've made, I've just addressed the comments there and used the types that were defined in the React implementation, I guess.

We can change the target branch from main to that PR if we want to track it there.

@MAST1999
Copy link
Contributor Author

I'm using this PR in my project and fixing problems for now.

@MAST1999 MAST1999 force-pushed the add-solid-form-hook branch from afe9475 to ebd3774 Compare June 29, 2025 23:10
This fixes and issue where some parts of the form, like submitting didn't work.
@crutchcorn
Copy link
Member

@MAST1999 you are AWESOME. Thank you for taking this on! What can we do to support?

@MAST1999
Copy link
Contributor Author

MAST1999 commented Jul 5, 2025

@MAST1999 you are AWESOME. Thank you for taking this on! What can we do to support?

Hey

I think it's ready, I'm using it in my hobby project and it's working.

But could always use a review or more testing.

@crutchcorn
Copy link
Member

Awesome! In that case do you wanna start writing some docs for it? Even if it's just copy+pasted from the React one with Solid.js syntax?

@MAST1999
Copy link
Contributor Author

MAST1999 commented Jul 5, 2025

Sounds good

Will get started!

@crutchcorn
Copy link
Member

@MAST1999 I saw that you added docs, are we ready for final review and/or merge or are we waiting on something else? :)

@MAST1999
Copy link
Contributor Author

MAST1999 commented Jul 6, 2025

@MAST1999 I saw that you added docs, are we ready for final review and/or merge or are we waiting on something else? :)

It's ready for final review.

I wanted to add examples as well but I noticed that we use released versions for examples, So I'll open another PR with examples after release.

@crutchcorn
Copy link
Member

Oh, actually, that's a great callout. Can we build out a large-form example before merging? It'll help me quickly validate that it's working as expected on my end as well.

We don't need to use the released version, pnpm will find the local version of the package and link to it. Then, when we release automatically it'll auto-bump this for us.

Completely safe.

@crutchcorn
Copy link
Member

Sorry for the continual last-minute requests 😅

@MAST1999
Copy link
Contributor Author

MAST1999 commented Jul 6, 2025

Don't worry about it.

This is what I wanted to do anyway 😁

@MAST1999
Copy link
Contributor Author

MAST1999 commented Jul 6, 2025

OK, found and interesting problem that I hadn't run into. It happens when I try using the store on the field.

I've added a comment on the text-field explaining the problem. You can reproduce it easily.

Looked around, but I couldn't figure out where the problem is exactly. If you access the fields itself for value and errors it works correctly now, if you try using the field().store it breaks.

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.

3 participants