How’s it going, I'm a Adam, a Full-Stack Engineer, actively searching for work. I'm all about JavaScript. And Frontend but don't let that fool you - I've also got some serious Backend skills.
Location
City of Bath, UK 🇬🇧
Education
10 plus years* active enterprise development experience and a Fine art degree 🎨
If Svelte is made of a compiler and is more of a language than anything else, and not a framework, then no Riot (I have considered using, riot and read up on it in the past) is not the same. Riot might be kind of closer to Stencil in some ways
The main difference is that Riot relies on Web Components a Web Component like API, while Svelte doesn't. The creator of Svelte has an article here in DEV about why he doesn't like Web Components. Svelte has an option to compile its components as Web Components, but TBH I don't know much people that does that (even more so now with the surge in "transitional apps", aka apps that have the best of SSR and SPA).
A few of those reasons are a bit far-fetched though. Like complaining that web components will have to define countless getters for HTML attributes; you can easily just fix that with a bit of meta-programming.
Some things mentioned in that post might haven't aged well, but the thing is that the author of Svelte is not "pro Web Components". Still if you use the API that comes with the browser, you need to use that awkward attributeChangedCallback method, and if we use an util on top of that or we just don't use it and create a custom approach, then we end up just saying that he's right and using libraries or frameworks is better than using the platform directly X_X .... I just wish at some point we get Web Components 2.0 and the API is better than the one we got for 1.0 😅
I kind of disagree though. Using a small abstraction layer to make custom elements more comfortable is still vastly different from using a complete framework that doesn't even use custom elements at all.
What's more, this often isn't even necessary for very simple components: the low-level APIs are often more than enough for those. And as they get more complex, you can first start using meta-programming directly inside the code of your component before moving to a microframework once even that becomes hard to handle, at which point you're probably already building a considerably big component.
As for web components 2.0, I think that's exactly where frameworks should come in. Whether you prefer a huge framework with thousands of lines of code or a small micro-framework like what I use, it's easy to make the current APIs much nicer to use at some performance cost by generating getters/setters or by looking up functions at runtime. The point is that the API leaves the decision to you whether you want to make those trade-offs.
You're right, my bad, it has a "Web component like API". Based on the syntax and the actual Riot site, I thought they were generating Web Components using the Web Component API (in their site you can see a grid element being used). I'll update my comment :D
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It has been done before. RiotJS is very similar and has been around considerably longer
If Svelte is made of a compiler and is more of a language than anything else, and not a framework, then no Riot (I have considered using, riot and read up on it in the past) is not the same. Riot might be kind of closer to Stencil in some ways
The main difference is that Riot relies on
Web Componentsa Web Component like API, while Svelte doesn't. The creator of Svelte has an article here in DEV about why he doesn't like Web Components. Svelte has an option to compile its components as Web Components, but TBH I don't know much people that does that (even more so now with the surge in "transitional apps", aka apps that have the best of SSR and SPA).A few of those reasons are a bit far-fetched though. Like complaining that web components will have to define countless getters for HTML attributes; you can easily just fix that with a bit of meta-programming.
Some things mentioned in that post might haven't aged well, but the thing is that the author of Svelte is not "pro Web Components". Still if you use the API that comes with the browser, you need to use that awkward
attributeChangedCallbackmethod, and if we use an util on top of that or we just don't use it and create a custom approach, then we end up just saying that he's right and using libraries or frameworks is better than using the platform directly X_X .... I just wish at some point we get Web Components 2.0 and the API is better than the one we got for 1.0 😅I kind of disagree though. Using a small abstraction layer to make custom elements more comfortable is still vastly different from using a complete framework that doesn't even use custom elements at all.
What's more, this often isn't even necessary for very simple components: the low-level APIs are often more than enough for those. And as they get more complex, you can first start using meta-programming directly inside the code of your component before moving to a microframework once even that becomes hard to handle, at which point you're probably already building a considerably big component.
As for web components 2.0, I think that's exactly where frameworks should come in. Whether you prefer a huge framework with thousands of lines of code or a small micro-framework like what I use, it's easy to make the current APIs much nicer to use at some performance cost by generating getters/setters or by looking up functions at runtime. The point is that the API leaves the decision to you whether you want to make those trade-offs.
To my knowledge - unless it has changed - Riot doesn't rely on web components either. It does have the option to compile to web components though
You're right, my bad, it has a "Web component like API". Based on the syntax and the actual Riot site, I thought they were generating Web Components using the Web Component API (in their site you can see a
gridelement being used). I'll update my comment :D