简体   繁体   中英

Is it possible to combine web components built with different versions of stencil on the same page?

Stencil JS generates native web components. I'm wondering if it's possible to combine web components build from different versions of Stencil JS on the same page.

Their FAQ implicitly claims this to be possible:

What dependencies does the Stencil runtime have? None. The code generated by Stencil does not rely on Stencil, but rather it generates highly-optimized, framework-free, stand-alone code which runs natively in the browser.

https://stenciljs.com/docs/faq#what-dependencies-does-the-stencil-runtime-have

Can anybody verify this claim?

是的,应该没有理由不,StencilJS 是一个编译器,所以生成的 javascript 文件是纯 javascript webcomponents,包中没有“模板”,所以它只是加载 vanilla javascript 文件

Yes it works. The final code is JavaScript which you will be using in the html page. There is nothing related to stencil specific there. StencilJs is not a framework!.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM