3 ms·
What I get is "Svelte is Unappealing" because the compiled code doesn't look like my code. If you minimize JS in general, it doesn't look like your code. Source
by excerionsforte 7y ago
What I get is "Svelte is Unappealing" because the compiled code doesn't look like my code. If you minimize JS in general, it doesn't look like your code. SourceMaps are provided for this purpose.
Unappealing because of the approach taken for compilation is not a good reason for me not to recommend Svelte. I will recommend Svelte or any library that helps cut down on the cognitive overload on trying to get your application up and running and provides a multitude a ways to debug state.
The API surface of Svelte is very tiny allowing you to do what you need to do without running into limitation. I've never had to complain about Svelte not exposing something, but sure have for React. API on React has changed multiple times causing modest rewrites of components. I have found the debugger with Svelte's @debug marker very helpful during development.
I'm glad I can use components compiled with Svelte in any application without bringing in a whole runtime and vice versa. It makes sharing natural and much easier than React, Angular, etc.. I dislike any frameworks (front and backend) that shut the door on previous work and make you conform to that world. Countless times I have questioned why do I need to build a component that implements pre-react work in React in order to use it in a React application. I should be able to bring in any library that works on the web today and use it without having it conform to "The Framework". I haven't had this trouble with Svelte.
I can agree that Svelte is early and there will be offspring that will likely leap frog and build on the ideas of Svelte.
- jbergens 7y agoYou can use useRef in React to get a DOM node and pass it to other parts if needed. Saying that every framework should be possible to combine with every other sounds very nice but probably impossible. Unless you restrict what you can do in a framework a lot. Most frameworks has components that has an api and a life cycle. Since frameworks have different api's and life cycles they are hard to combine in one application. Not impossible but hard. I have a feeling this is somewhat true for Svelte also. How would I how to update a state inside a Svelte component from the outside? There is a standard for components, Web Components, but it did not exist when Angular and React was created. It also works in a different way and don't solve the exact same use cases.
- excerionsforte 7y agoI am aware of useRef. > Saying that every framework should be possible to combine with every other sounds very nice but probably impossible. I said specifically that I disliked frameworks that want me to conform. I did not say that all frameworks should conform to me. > How would I how to update a state inside a Svelte component from the outside? How would you update a Web Component is the same way this works. https://dev.to/silvio/how-to-create-a-web-components-in-svelte-2g4j https://dev.to/silvio/how-to-create-a-web-components-in-svel...