Replies: 5 comments
-
Nice, thanks Paul! I think it's a great idea to improve our forms setup after 2 years. And this approach does look promising |
Beta Was this translation helpful? Give feedback.
-
Hey, @paulm17! This is SO cool! I haven't had the time to dig into Blitz 2.0 yet, but it's on my R&D goals to do so, and now that you're trying to bring an approach inspired by Remix Forms to it, it becomes even more interesting! The philosophies behind Blitz and what we're trying to accomplish at Seasoned are very aligned 💪🏼 Yes, we have temporarily waned on the project, mainly because we're focused on using the library as much as possible before we add to the APIs. One of the reasons we could come up with good APIs so far is we had a lot of time to feel the pain points of our previous stack before creating new abstractions. That said, if you have a clear idea for new abstractions, we'd love to talk and see if we can build them together. Maybe even see if we can share a low-level abstraction layer between the Blitz and standalone Remix versions. |
Beta Was this translation helpful? Give feedback.
-
Beautiful, @paulm17! That would be great! I can say we can achieve the same Form layout with I am reviewing your fork and it's looking great, I haven't used react-hook-form myself yet on a bigger project, but I'll give it a check. |
Beta Was this translation helpful? Give feedback.
-
I've written and re-written this comment like 5 times now, thinking of good flexible api is hard 🥴 anyways, the following pop up
I wrote a few possible apis that support all or some of these requirements, but I always find myself overcomplicating and creating boilerplate code, or just not being elegant enough. Maybe I'm just reaching for the stars, but at the very least I think we should take advantage of the "nativeness" of this form handling and interop it with other moving parts from the blitzjs family for a better DX at the cost of being opinionated.. |
Beta Was this translation helpful? Give feedback.
-
I took a look at the repository today and I'm gonna start using it together with the team I lead on a freelance project using Blitz. Currently we use Formik and we have a bunch of custom components and my objective is to understand what are the gains versus using Formik, specially for custom stuff. On a first look, it's very clear that a lot of boilerplate can be saved for more basic stuff. but in my experience, I think in most of the situations we'll have to be in control of the rendering of the Fields, even if for layouting reasons only (ie spreading the fields across multiple columns). so I want to experience the benefits I can still gain using Remix Forms. Initially I like it a lot that I don't have to import multiple components and I'm a fan of the render props pattern. If using custom components is easy enough with this fork of Remix Forms, potentially adopting this is a win-win situation. I'll get back once I get to use more of it, but I'm excited about trying it. |
Beta Was this translation helpful? Give feedback.
-
To understand what remix-forms provides, please take a look at the following below...
Website (examples): https://remix-forms.seasoned.cc/
YouTube demo: https://www.youtube.com/watch?v=IN-TElTkVmU
Code: https://github.com/SeasonedSoftware/remix-forms/blob/main/packages/remix-forms/src/Form.tsx
My fork for BlitzJS: https://github.com/paulm17/remixForms
I'm raising this RFC because I think the current form system should be replaced with a similar form system as to what remix-forms provides for Remix.
I've been using Blitz since before Sept '20. I've always found the current form system could be much better. It's good now, don't get me wrong... anyway when I saw what the guys over SeasonedSoftware came up with. I was blown away. 😄
Since I was using RHF already, I immediately went over their code and forked what I could. The following is what I've been able to do:
Minimal example:
More form items example:
A complete example:
(click to see the video)
Why this method.
Potential pitfalls
However, there are some caveats to this approach.
Thanks for taking the time to read. 👍
Beta Was this translation helpful? Give feedback.
All reactions