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: add react-server bundle #11162

Merged
merged 14 commits into from Nov 8, 2023
Merged

Conversation

kotarella1110
Copy link
Member

@kotarella1110 kotarella1110 commented Nov 7, 2023

Related Issues

Changes Made

Server Actions are executed within the react-server context, which can lead to errors when importing react-hook-form within Server Actions.

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

This results in errors even when using only react-hook-form logic in Server Actions.
This PR aims to enable the use of react-hook-form's logic and utilities within the react-server context. This is achieved by adding react-server through conditional exports.

Once this is merged, it will also make my previously created PR react-hook-form/resolvers#636 for @hookform/resolvers unnecessary.

Copy link

codesandbox bot commented Nov 7, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link
Contributor

github-actions bot commented Nov 7, 2023

Size Change: 0 B

Total Size: 20.2 kB

ℹ️ View Unchanged
Filename Size
dist/index.cjs.js 10.1 kB
dist/index.umd.js 10.1 kB

compressed-size-action

@kotarella1110 kotarella1110 changed the base branch from master to chore/upgrade-node November 7, 2023 13:52
@kotarella1110 kotarella1110 marked this pull request as ready for review November 7, 2023 15:01
@kotarella1110
Copy link
Member Author

@bluebill1049
I checked out #11163 branch to check its functionality in CodeSandbox CI. Therefore, I kindly request that you merge #11163 first before merging this PR.

bluebill1049
bluebill1049 previously approved these changes Nov 7, 2023
Base automatically changed from chore/upgrade-node to master November 8, 2023 01:10
@bluebill1049 bluebill1049 dismissed their stale review November 8, 2023 01:10

The base branch was changed.

@bluebill1049
Copy link
Member

Do you want to merge this?

@kotarella1110
Copy link
Member Author

I want to merge this!

@bluebill1049 bluebill1049 merged commit 8f80f4c into master Nov 8, 2023
7 checks passed
@bluebill1049 bluebill1049 deleted the feat/add-react-server-context branch November 8, 2023 01:31
@joakim-roos
Copy link

joakim-roos commented Nov 9, 2023

Has this been released yet? If so, which version?

@chrisb2244
Copy link

Has this been released yet? If so, which version?

@joakim-roos I think you want to be watching this PR: #11061
Looks pretty exciting...

@CombeeMike
Copy link

I'm experiencing issues caused by the react-server condition export which was added here.
See this discussion for more details.
I'd really appreciate some help with this.

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

5 participants