EasyWebApp/WebCell

支持IE11的slot处理和ssr吗

chenyulun opened this issue · 3 comments

支持slot低版本和ssr处理吗

  1. Web Components 官方 polyfill 对 IE 11 <slot /> 的支持貌似还有问题:https://stackoverflow.com/questions/66393616/angular11-webcomponents-polyfills-ie11-nojoy
  2. SSR 的支持我正在研究标准提案https://web.dev/declarative-shadow-dom/

新标准 ElementInternals 提供了对 <template shadowRootMode="open" /> 的支持,因此 WebCell v3 基于此提供了对 SSR 的组件引擎级支持:

internals = this.attachInternals();
renderer = new DOMRenderer();
get root(): ParentNode {
return this.internals.shadowRoot || this;
}
constructor() {
super();
if (meta.mode && !this.internals.shadowRoot)
this.attachShadow(meta as ShadowRootInit);

但还需要类似 Next.js 这样的开发框架来输出符合新标准的 HTML 代码。