Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 4, 2025

Description

Follow-up to #975. After parseRenderRequest(request) normalizes the request (removing _.rsc suffix from URL), code should use the normalized request instead of the original request object.

Updated three example files to use the normalized request by reassigning request after parsing:

  • packages/plugin-rsc/examples/starter-cf-single/src/framework/entry.rsc.tsx
  • packages/plugin-rsc/examples/starter/src/framework/entry.rsc.tsx
  • packages/plugin-rsc/examples/basic/src/framework/entry.rsc.tsx
  const renderRequest = parseRenderRequest(request)
+ request = renderRequest.request

This allows the code to continue using request directly (now pointing to the normalized request) instead of the more verbose renderRequest.request throughout the handler.

Original prompt

Follow up to #975
in entry.rsc.tsx, we do parseRenderRequest(request) to normalize rsc and html request. After this normalization, we shouldn't access request but access renderRequest.request instead. For example, request.formData should be renderRequest.request.formData etc.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

….rsc.tsx files

Co-authored-by: hi-ogawa <4232207+hi-ogawa@users.noreply.github.com>
Copilot AI changed the title [WIP] Update request handling in entry.rsc.tsx fix(rsc): use renderRequest.request after parseRenderRequest in entry.rsc.tsx Dec 4, 2025
Copilot AI requested a review from hi-ogawa December 4, 2025 09:01
Copilot finished work on behalf of hi-ogawa December 4, 2025 09:01
Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Can we get away with reassigning request like this?

const renderRequest = parseRenderRequest(request)
request = renderRequest.request

Co-authored-by: hi-ogawa <4232207+hi-ogawa@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 4, 2025

@copilot Can we get away with reassigning request like this?

...

Yes, done in 607abb7. Now each file reassigns request = renderRequest.request right after parsing, allowing direct use of request throughout the handler.

Copilot AI changed the title fix(rsc): use renderRequest.request after parseRenderRequest in entry.rsc.tsx fix(rsc): use normalized request after parseRenderRequest in entry.rsc.tsx Dec 4, 2025
Copilot AI requested a review from hi-ogawa December 4, 2025 09:06
Copilot finished work on behalf of hi-ogawa December 4, 2025 09:06
@hi-ogawa hi-ogawa changed the title fix(rsc): use normalized request after parseRenderRequest in entry.rsc.tsx chore(rsc/examples): use normalized request after parseRenderRequest Dec 4, 2025
@hi-ogawa hi-ogawa marked this pull request as ready for review December 4, 2025 09:10
@hi-ogawa hi-ogawa merged commit b14456c into main Dec 4, 2025
20 checks passed
@hi-ogawa hi-ogawa deleted the copilot/update-request-access-in-entry branch December 4, 2025 09:32
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.

2 participants