Replies: 3 comments 3 replies
-
做不到吧,我了解到的是webcomponents方案,都没法支持SSR,可以搜索下webcomponents怎么支持ssr |
Beta Was this translation helpful? Give feedback.
-
从源码上看,lit的ssr方案走的就是DSD(Declarative Shadow DOM)
https://github.com/lit/lit/blob/main/dev-docs/design/ssr-react.md#background |
Beta Was this translation helpful? Give feedback.
-
不过即使不引入DSD,只要在打包构建的流程上,保证不使用'windows'变量,替换成globalThis;然后适当加入一些补丁,就可以解决像这样的问题。 只不过这么做的话当然会导致hydration完成前,组件只有light-dom;但至少项目能跑起来了。 |
Beta Was this translation helpful? Give feedback.
-
请问 quarkd 是怎么做到服务端渲染
Beta Was this translation helpful? Give feedback.
All reactions