refactor(rsc): decrypt cache captures once - #1403
Draft
hi-ogawa wants to merge 23 commits into
Draft
Conversation
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Exclude React form transport fields from cache identity while preserving the original FormData for execution. Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Keep FormData cache identity unchanged and point to custom form adaptation as the framework-level improvement path. Co-authored-by: OpenCode <noreply@opencode.ai>
Store the asynchronous encryption result in the envelope so the cache wrapper can inspect its sentinel without awaiting the argument. Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Adapt encrypted transport arguments to decoded implementation arguments in the cache runtime, allowing the generated implementation to destructure captures directly. Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai> # Conflicts: # packages/plugin-rsc/examples/use-cache-callable/callable-cache-plugin.ts # packages/plugin-rsc/examples/use-cache-callable/src/framework/use-cache-runtime.tsx
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
use cacheexample with closure encryption #1398 (comment)The protected-captures demo currently decrypts an envelope once for logical cache identity and again inside the hoister-generated implementation. This changes the framework adapter so the cache runtime decrypts the transport envelope once, uses flattened captures for cache identity, and passes the decoded capture array to the private implementation.
The existing transform hooks are sufficient:
encodestill creates the encrypted envelope, whiledecodeemits direct capture-array destructuring because the runtime now owns decryption. No core transform change is required.Verification:
pnpm buildpnpm tscinpackages/plugin-rscpnpm test-e2e use-cache-callable.test.tsinpackages/plugin-rsc(22 passed)