日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

SAP Spartacus 服务器端渲染文件 server.js 和构建后的 main.js 对比

發(fā)布時(shí)間:2023/12/19 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 SAP Spartacus 服务器端渲染文件 server.js 和构建后的 main.js 对比 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

構(gòu)建之前:

構(gòu)建之后:

其中 express__WEBPACK_IMPORTED_MODULE_3__ 來自 module uX2x:

uX2x 來自 node_modules/express/index.js:

其依賴 K0zx.

SAP Spartacus 服務(wù)器端渲染的一個(gè)局限

The SSR process is currently running in mobile-first mode, which means that some parts of the UI are not rendered because of the adaptive layout of mobile vs desktop.

目前 SAP Spartacus SSR 運(yùn)行在 mobile-first 模式下,意味著有些 UI 不會(huì)得到渲染,因?yàn)?Mobile 和桌面端不同的響應(yīng)式布局策略。

This is a serious limitation for crawlers as they’re not able to index the full content.

對于網(wǎng)絡(luò)爬蟲來說,這是一個(gè)嚴(yán)重的局限,因?yàn)槿绱艘粊?#xff0c;爬蟲無法爬取完整的頁面內(nèi)容。

Especially when the content is important (such as the main navigation).

對于有些重要的內(nèi)容,比如 main navigation,這個(gè)局限性尤其致命。

slots that are not displayed in mobile are not rendered in SSR.

Our SSR (nowadays at least) only exposes the DOM structure, no HTML.

只暴露 DOM 結(jié)構(gòu),而不是 HTML?

The screen-size driven responsive CSS is applied on top of this.

響應(yīng)式 CSS 施加在 DOM 結(jié)構(gòu)上。

There is however a very small piece in Spartacus that renders a different DOM based on the device/screen-size, which is caused by the LayoutConfig: the header with the navigation will be rendered differently.

帶有導(dǎo)航的 header 渲染結(jié)果有所差異。

Normally you would not experience this in the browser, because whenever resizing the browser, the DOM got re-rendered.

瀏覽器里,每次調(diào)整其尺寸,DOM 都會(huì)重新渲染。

In this case however, the SSR response will not be re-rendered as long as the user doesn’t change the screen size. If the user just loads the SSR response, it will likely only show the mobile DOM, with the desktop CSS.

更多Jerry的原創(chuàng)文章,盡在:“汪子熙”:

總結(jié)

以上是生活随笔為你收集整理的SAP Spartacus 服务器端渲染文件 server.js 和构建后的 main.js 对比的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。