Skip to content
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

feat: Support Server Actions #636

Closed
wants to merge 18 commits into from

Conversation

kotarella1110
Copy link
Member

@kotarella1110 kotarella1110 commented Oct 18, 2023

Related Issue

react-hook-form/react-hook-form#10391

Core PR

#636

Summary

This PR is an experimental implementation for supporting Server Actions in React Hook Form. Its purpose is to explore the best way to support Server Actions within React Hook Form, and it's important to note that the changes proposed in this PR may not be adopted as is.

Additionally, this PR makes minimal changes, and there are various other considerations that need to be addressed.

Changes Made

When importing resolvers in a react-server context, the following error occurs:

TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/context-in-server-component

To resolve this error, we have made changes to import only logic and utilities that have been conditionally exported. Currently, I have changed only to zodResolver.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 18, 2023

Size Change: +10 B (0%)

Total Size: 25.4 kB

Filename Size Change
dist/resolvers.js 471 B +4 B (+1%)
dist/resolvers.module.js 485 B +3 B (+1%)
dist/resolvers.umd.js 559 B -3 B (-1%)
zod/dist/zod.js 583 B +3 B (+1%)
zod/dist/zod.module.js 605 B +5 B (+1%)
zod/dist/zod.umd.js 685 B -2 B (0%)
ℹ️ View Unchanged
Filename Size
ajv/dist/ajv.js 638 B
ajv/dist/ajv.module.js 594 B
ajv/dist/ajv.umd.js 750 B
arktype/dist/arktype.js 328 B
arktype/dist/arktype.module.js 343 B
arktype/dist/arktype.umd.js 423 B
class-validator/dist/class-validator.js 537 B
class-validator/dist/class-validator.module.js 561 B
class-validator/dist/class-validator.umd.js 640 B
computed-types/dist/computed-types.js 387 B
computed-types/dist/computed-types.module.js 401 B
computed-types/dist/computed-types.umd.js 477 B
io-ts/dist/io-ts.js 1.28 kB
io-ts/dist/io-ts.module.js 1.18 kB
io-ts/dist/io-ts.umd.js 1.41 kB
joi/dist/joi.js 591 B
joi/dist/joi.module.js 609 B
joi/dist/joi.umd.js 696 B
nope/dist/nope.js 345 B
nope/dist/nope.module.js 365 B
nope/dist/nope.umd.js 434 B
superstruct/dist/superstruct.js 324 B
superstruct/dist/superstruct.module.js 342 B
superstruct/dist/superstruct.umd.js 424 B
typanion/dist/typanion.js 330 B
typanion/dist/typanion.module.js 344 B
typanion/dist/typanion.umd.js 424 B
typebox/dist/typebox.js 464 B
typebox/dist/typebox.module.js 481 B
typebox/dist/typebox.umd.js 579 B
valibot/dist/valibot.js 577 B
valibot/dist/valibot.module.js 594 B
valibot/dist/valibot.umd.js 684 B
vest/dist/vest.js 479 B
vest/dist/vest.module.js 443 B
vest/dist/vest.umd.js 569 B
yup/dist/yup.js 625 B
yup/dist/yup.module.js 639 B
yup/dist/yup.umd.js 728 B

compressed-size-action

@kotarella1110 kotarella1110 changed the title Support Server Actions feat: Support Server Actions Oct 18, 2023
@kotarella1110 kotarella1110 changed the base branch from master to ci/change-codesandbox-ci-setting October 18, 2023 15:49
Base automatically changed from ci/change-codesandbox-ci-setting to master October 18, 2023 20:42
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.

None yet

1 participant