-
Notifications
You must be signed in to change notification settings - Fork 3
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
refactor(react-server): use official encodeReply/decodeReply/decodeAction/decodeFormState
+ feat: support useActionState
#282
Merged
Merged
Changes from 22 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
24c5e17
refactor(react-server): use `encodeReply/decodeReply`
hi-ogawa 7bc3043
refactor: cleanup
hi-ogawa 994b80d
refactor: cleanup
hi-ogawa 3d98017
chore: comment
hi-ogawa 37f1ab9
chore: assert ssr
hi-ogawa 34d03b1
test: action after client render
hi-ogawa d2f60fc
Merge branch 'main' into refactor-use-encodeReply-decodeReply
hi-ogawa 669cf97
refactor(react-server): use official `createServerReference` (#283)
hi-ogawa 2af6075
Merge branch 'main' into refactor-use-encodeReply-decodeReply
hi-ogawa e7d87c2
refactor(react-server): use official `decodeAction/decodeFormState` (…
hi-ogawa 5568455
Merge branch 'main' into refactor-use-encodeReply-decodeReply
hi-ogawa 92de3e3
chore: use React.useActionState
hi-ogawa 9e87c64
wip: js action return value
hi-ogawa 9d0a3c3
wip: action return value (give up global action pending)
hi-ogawa adc98b9
chore: replace DIY useActionData
hi-ogawa 3faa6d3
test: skip actionPending test
hi-ogawa ac42f49
chore: remove useActionData
hi-ogawa 39cf205
wip: decodeFormState
hi-ogawa 37fed28
fix: __startActionTransition
hi-ogawa b3d4431
chore: unused actionResult.id
hi-ogawa 1aed799
feat: `useActionContext`
hi-ogawa a1ea233
test: revert skip
hi-ogawa 6c85707
chore: tweak
hi-ogawa c187900
chore: comment
hi-ogawa 60acbff
chore: more examples
hi-ogawa 5f73822
test: test useActionState prev
hi-ogawa 536dee0
chore: remove unused
hi-ogawa 346e35f
test: test action bind
hi-ogawa e76be85
wip: non form action
hi-ogawa 7a93367
wip: support non form action
hi-ogawa 9957170
test: e2e
hi-ogawa 1c14083
chore: re-export typed useActionState
hi-ogawa 06033ba
chore: release
hi-ogawa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
packages/react-server/examples/basic/src/routes/test/revalidate/_action.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
"use server"; | ||
|
||
import type { ActionContext } from "@hiogawa/react-server/server"; | ||
import { useActionContext } from "@hiogawa/react-server/server"; | ||
|
||
export async function actionTestRevalidate(this: ActionContext) { | ||
this.revalidate = true; | ||
export async function actionTestRevalidate() { | ||
useActionContext().revalidate = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
packages/react-server/src/features/server-action/client.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: move out action form state from initial ssr stream?