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: rsc server route #6528

Merged
merged 9 commits into from
Sep 13, 2023
Merged

feat: rsc server route #6528

merged 9 commits into from
Sep 13, 2023

Conversation

chenjun1011
Copy link
Collaborator

@chenjun1011 chenjun1011 commented Sep 11, 2023

feat:

  • server route
  • server context

@chenjun1011 chenjun1011 added the need review Need Review label Sep 11, 2023
@chenjun1011 chenjun1011 changed the title feat: server route feat: rsc server route Sep 11, 2023
@@ -12,7 +12,8 @@
"@ice/app": "workspace:*",
"@ice/runtime": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"react-router-dom": "6.14.2"
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个依赖应该不需要

location,
renderOptions,
}: RenderServerEntry,
): Promise<Response> {
const { Document } = renderOptions;
const appContext = runtime.getAppContext();
const { routes, routePath, loaderData, basename } = appContext;
const { routes, matches, routeModules, requestContext, ...staticContext } = appContext;
Copy link
Collaborator

Choose a reason for hiding this comment

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

warning 需要处理

@@ -289,6 +288,11 @@ async function doRender(serverContext: ServerContext, renderOptions: RenderOptio
}
}

// Render Document for RSC App.
Copy link
Collaborator

Choose a reason for hiding this comment

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

RSC 相关逻辑可以统一考虑在 runRSCApp 下处理,公共的 server 逻辑后面可以单独抽象

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 85.33% and project coverage change: -0.07% ⚠️

Comparison is base (d28ddd2) 80.01% compared to head (e9a6894) 79.95%.

Additional details and impacted files
@@             Coverage Diff              @@
##           feat-rsc    #6528      +/-   ##
============================================
- Coverage     80.01%   79.95%   -0.07%     
============================================
  Files           254      255       +1     
  Lines         22200    22157      -43     
  Branches       2729     2727       -2     
============================================
- Hits          17764    17715      -49     
- Misses         4392     4398       +6     
  Partials         44       44              
Files Changed Coverage Δ
packages/ice/src/plugins/web/task.ts 92.59% <0.00%> (ø)
packages/runtime/src/runRSCClientApp.tsx 30.76% <28.57%> (ø)
packages/runtime/src/AppContext.tsx 89.65% <57.14%> (-10.35%) ⬇️
packages/runtime/src/utils/getLocation.ts 90.90% <90.90%> (ø)
packages/ice/src/routes.ts 97.67% <100.00%> (+0.01%) ⬆️
packages/runtime/src/index.ts 84.30% <100.00%> (+0.09%) ⬆️
packages/runtime/src/routes.tsx 74.89% <100.00%> (+0.33%) ⬆️
packages/runtime/src/runServerApp.tsx 73.60% <100.00%> (-0.36%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ClarkXia ClarkXia merged commit cfe85e4 into feat-rsc Sep 13, 2023
6 checks passed
@ClarkXia ClarkXia deleted the feat-server-route branch September 13, 2023 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need review Need Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants