Skip to content

Commit

Permalink
fix: 在有basename的情况下__serverLoader的请求路径需要加上basename (#11739)
Browse files Browse the repository at this point in the history
* fix: dev环境构建SSR server.js时,环境判断错误导致输出的dev产物带上了hash

* Update packages/preset-umi/src/features/ssr/webpack/webpack.ts

Co-authored-by: chencheng (云谦) <[email protected]>

* fix: dev环境构建SSR server.js时,环境判断错误导致输出的dev产物带上了hash

* feature: 支持自定义SSR构建目标,默认为node,可配置为webworker以支持运行在类似Cloudflare Workers的平台
以解决 react-dom/server renderToReadableStream 不存在的问题

* feature: getManifest支持传入sourceDir表示SSR产物目录

* feature: getManifest支持传入sourceDir表示SSR产物目录

* fix: rendertoreadablestream is not a function

* Revert "feature: 支持自定义SSR构建目标,默认为node,可配置为webworker以支持运行在类似Cloudflare Workers的平台"

This reverts commit 5b0946a.

* fix: rendertoreadablestream is not a function

* Update packages/server/src/ssr.ts

Co-authored-by: 咲奈Sakina <[email protected]>

* Update packages/server/src/ssr.ts

Co-authored-by: 咲奈Sakina <[email protected]>

* fix: 还原g_getAssets

* fix: 被执行时才调用getManifest(),避免在入口立即调用getManifest()

* fix: 被执行时才调用getManifest(),避免在入口立即调用getManifest()

* fix: 被执行时才调用getManifest(),避免在入口立即调用getManifest()

* feature: SSR模式下,多输出一份和index.html完全一致的*.html文件,用于ER场景

* feature: SSR模式下,多输出一份和index.html完全一致的*.html文件,用于ER场景

* fix: SSR withoutHTML模式下,包一层<div id="root">{app}</div>

* fix: 回滚SSR模式下,多输出一份和index.html完全一致的*.html文件,用于ER场景

* fix: SSR withoutHTML模式下也需要注入loaderData数据用于注水时

* fix: 在有basename的情况下__serverLoader的请求路径需要加上basename

---------

Co-authored-by: 奇风 <[email protected]>
Co-authored-by: chencheng (云谦) <[email protected]>
Co-authored-by: 咲奈Sakina <[email protected]>
  • Loading branch information
4 people authored Oct 16, 2023
1 parent 1babc1e commit 9e15f1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/renderer-react/src/browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ const getBrowser = (
// server loader
// use ?. since routes patched with patchClientRoutes is not exists in opts.routes
if (!isFirst && opts.routes[id]?.hasServerLoader) {
fetch('/__serverLoader?route=' + id)
// 在有basename的情况下__serverLoader的请求路径需要加上basename
fetch((basename.endsWith('/') ? basename : basename + '/') + '__serverLoader?route=' + id)
.then((d) => d.json())
.then((data) => {
// setServerLoaderData when startTransition because if ssr is enabled,
Expand Down

0 comments on commit 9e15f1e

Please sign in to comment.