-
Notifications
You must be signed in to change notification settings - Fork 1k
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
chore(refactor): Split rwjs/forms up into several smaller logical units #10428
Conversation
…auth-provider-p1 * 'main' of github.com:redwoodjs/redwood: fix(middleware): Handle POST requests in middleware router too (redwoodjs#10418) chore(ci): get ci running on next (redwoodjs#10432) RSC: Explain noExternal vite config option (redwoodjs#10429) chore(web): Fix .d.ts overwrite build issue (redwoodjs#10431) chore(web): .js imports to prep for ESM (redwoodjs#10430) chore(refactor): Split rwjs/forms up into several smaller logical units (redwoodjs#10428) chore(rsc): simplify `noExternals` config (redwoodjs#10220) chore(deps): Update vite to 5.2.8 (redwoodjs#10427) chore(auth): Convert `@redwoodjs/auth` to ESM+CJS dual build (redwoodjs#10417) chore(framework-tools): Warn about missing metafile (redwoodjs#10426) chore(test): Switch rwjs/auth over to vitest (redwoodjs#10423) chore(whatwg-fetch): Switch to importing instead of requiring (redwoodjs#10424) chore(deps): bump undici from 5.28.3 to 5.28.4 in /.github/actions/check_changesets (redwoodjs#10421) chore(route-manifest): Add relativeFilePath to route manifest (redwoodjs#10416)
…th-mw-auth * 'main' of github.com:redwoodjs/redwood: (21 commits) fix(auth): Handle when authorization header is lowercased (#10442) Update rbac.md - code match (#10405) chore: make crwa e2e test work across branches (#10437) feat: [Auth] Common AuthProvider & use* changes for middleware auth (#10420) fix(cli): only show webpack options for dev if `bundler = "webpack"` (#10359) fix(vercel): specify build env vars as a string (#10436) fix(vercel): write `vercel.json` as a part of setup (#10355) fix(middleware): Handle POST requests in middleware router too (#10418) chore(ci): get ci running on next (#10432) RSC: Explain noExternal vite config option (#10429) chore(web): Fix .d.ts overwrite build issue (#10431) chore(web): .js imports to prep for ESM (#10430) chore(refactor): Split rwjs/forms up into several smaller logical units (#10428) chore(rsc): simplify `noExternals` config (#10220) chore(deps): Update vite to 5.2.8 (#10427) chore(auth): Convert `@redwoodjs/auth` to ESM+CJS dual build (#10417) chore(framework-tools): Warn about missing metafile (#10426) chore(test): Switch rwjs/auth over to vitest (#10423) chore(whatwg-fetch): Switch to importing instead of requiring (#10424) chore(deps): bump undici from 5.28.3 to 5.28.4 in /.github/actions/check_changesets (#10421) ...
@Tobbe As part of this refactoring |
Definitely a valid use-case that we want to support! Would you like to create a PR with export fields in package.json for the types? And new type export files if needed. |
Sure, I'll do, thanks for the prompt reply 🙌 |
@Josh-Walker-GM do you have any preferences here for how we handle the exports? |
@antonmoiseev Actually, after looking into this some more, and talking to @Josh-Walker-GM, I/we think it's probably best to just add type exports to the index file. Do you agree? So in the generated export { CheckboxField } from './CheckboxField';
export type { CheckboxFieldProps } from './CheckboxField'; |
I don't really know good enough how Redwood is structured and built internally, so I don't have an opinion here. But generally it looks straightforward and reasonable to me. Thanks for guiding, I'm planning to prepare the PR tomorrow. |
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.