chore(refactor): Split rwjs/forms up into several smaller logical units #10428
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.
When debugging why we couldn't upgrade Vite (#10427) I had to work with our
@redwoodjs/forms
package. And that was a mess. A single file with a thousand lines of code. Impossible to get an overview of what's going on.This PR refactors the forms package to split that one huge file out into smaller logical units that are easier to reason about.
The
index.tsx
file is now more like a barrel file, which is something we most likely want to move away from at some point, but it's a pattern we have in a lot of our packages, so it should feel familiar for anyone used to our codebase. Plus, this refactoring makes it easier to see what's going on, so when we eventually do move away from barrel exports it should be easier to do so now.