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 ssr types and refactor some logic #11784

Merged
merged 6 commits into from
Nov 6, 2023
Merged

Conversation

fz6m
Copy link
Contributor

@fz6m fz6m commented Oct 23, 2023

  1. 重构少量 fix: SSR withoutHTML模式下,包一层<div id="root">{app}</div> #11724feature: 支持serverLoader中读取url和headers #11755 两个 PR 里不优雅的书写。

  2. 新增 serverLoaderuseServerLoaderData 的类型。

@vercel
Copy link

vercel bot commented Oct 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
umi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2023 9:51pm

@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

Attention: 26 lines in your changes are missing coverage. Please review.

Comparison is base (a830383) 29.01% compared to head (6986d63) 29.00%.
Report is 4 commits behind head on master.

❗ Current head 6986d63 differs from pull request most recent head 1ef536b. Consider uploading reports for the commit 1ef536b to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11784      +/-   ##
==========================================
- Coverage   29.01%   29.00%   -0.02%     
==========================================
  Files         488      488              
  Lines       14835    14841       +6     
  Branches     3517     3514       -3     
==========================================
  Hits         4304     4304              
- Misses       9771     9777       +6     
  Partials      760      760              
Files Coverage Δ
packages/server/src/types.ts 0.00% <ø> (ø)
packages/renderer-react/src/appContext.ts 17.39% <0.00%> (ø)
packages/renderer-react/src/browser.tsx 0.00% <0.00%> (ø)
packages/preset-umi/src/features/ssr/ssr.ts 0.00% <0.00%> (ø)
packages/server/src/ssr.ts 0.00% <0.00%> (ø)

... and 4 files with indirect coverage changes

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

@fz6m fz6m merged commit 48b5d3c into umijs:master Nov 6, 2023
22 of 23 checks passed
@@ -266,8 +266,9 @@ const getBrowser = (
// use ?. since routes patched with patchClientRoutes is not exists in opts.routes
if (!isFirst && opts.routes[id]?.hasServerLoader) {
// 在有basename的情况下__serverLoader的请求路径需要加上basename
fetch((basename.endsWith('/') ? basename : basename + '/') + '__serverLoader?route=' + id, {
credentials: 'include'
const url = `${withEndSlash(basename)}'__serverLoader?route='${id}`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

此合并冲突多余的引号在 #11726 删除。

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.

1 participant