Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

想问下作者 #17

Closed
iamsee opened this issue Nov 25, 2022 · 2 comments
Closed

想问下作者 #17

iamsee opened this issue Nov 25, 2022 · 2 comments

Comments

@iamsee
Copy link

iamsee commented Nov 25, 2022

我最近在调研svelte,想用它写一些ui组件用于angular和react.
看到有人说:“zero runtime只是宣传口号,它并不能在所有的场景下做到zero runtime。”
所以请问下载什么情况下又runtime,又或者是否开发的组件都能兼容angular和react

@dufu1991
Copy link
Owner

我对 Svelte 的学习还没有深入到你说这个程度,只是随便聊聊自己的看法。
在我看来,不能把 Svelte 看成一个框架,比较官方的说法是一个编译器,可以将按照 Svelte 语法写的组件编译成纯 JS。依我看更具体一点,它就是一个 Rollup 生态内的插件,由于 Vite 也使用了 Rollup,自然 Vite 也支持 Svelte。
可能是我基础知识还不够,我不懂也没关心 zero runtime 这些概念,用它开发爽就完了。Svelte 可以直接编译出 Web Components,但是目前 Web Components 刚刚出现,后续如何发展还不明朗,我也只是了解了一下。而用 Svelte 开发组件放在 Angular 或 React 项目里,可能是我还没真正理解到如此做的好处,目前我肯定不会这样做,这就是自寻烦恼。这个思路搜一下也有实现的步骤,你可以参考一下,我确实不懂。

@iamsee
Copy link
Author

iamsee commented Dec 2, 2022

@dufu1991 感谢,自我尝试了下build出web components是可行的,但是对传入传出的方式还需要封装

@dufu1991 dufu1991 closed this as completed Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants