I'm rapidly becoming a huge Svelte fan. Quick self-promotion plug (but in the name of altruism): I've been working on an open source project that glues together Svelte (on the front end) and Crystal (on the back end). https://github.com/noahlh/celestite Two slightly obscure (but growing) languages/frameworks, but hey, gotta pick a niche. Contributions & feedback welcome!
Why Svelte is our choice for a large web project
101–110 of 136 posts
Re: Why Svelte is our choice for a large web project
#102I want my templates as first-class citizens. If I have to deal with strings and weird, half-baked syntax for loops and conditionals, I'm out. JSX really spoiled me to the point that if there isn't JSX, I don't want it.
Re: Why Svelte is our choice for a large web project
#103Earlier quoted context omitted.
React 16 is 2.2 KB or 34.8 KB if you include react-dom, Vue 2.4 is 20.9 KB, and jquery 2.1 is 28.87 KB. If you're using a bundler that can create chunks, your user is at best downloading this once in a blue moon. The reply page I'm using now is 10% bigger total than these packages and has to be pulled every time apparently. By what metric are these "huge runtime libraries"?
> React 16 is 2.2 KB or 34.8 KB if you include react-dom Gzipped. Uncompressed React is 6.3KB and react-dom is 114.5KB (and of course you're going to include react-dom, how else would you use it?!) Uncompressed matters because it takes a device longer to parse more code. Particularly in a world where low end Android devices are being shipped with slow CPUs and very little RAM. The real killer combination is React plu…
Or Inferno, or Mithril, or Solid.
Re: Why Svelte is our choice for a large web project
#104I like what I see from Svelte but I'm afraid it's going down the exact same road Meteor did. Too many options, not enough Blessed Solutions for basic things. Take routing for example, in Svelte you have a lot of options but no real #1 "Svelte Recommends (tm)". They should solve this problem before it gets out of hand. It killed Meteor.
Sapper provides a great option for routing. I view that as the official routing solution, but there are other options too.
Re: Why Svelte is our choice for a large web project
#105The idea of having markup+logic+styles in the same file works for small components but it gets muddy on bigger ones. It can be argued that components should be as small as possible but OTOH having to create a new file for every damn component gets old very quickly.
For the past 2-3 years I've been working again with JSX based libraries and being able to create micro components on the same JS file makes a lot more sense.
I've also gone back to regular SASS and moved all CSS outside of components (except for dynamic CSS). It works better IMO than single file components.
Re: Why Svelte is our choice for a large web project
#106I love React and I love Svelte. There, I said it. These are the complaints that standout for me with Svelte after using it for a few months: * Sub-par editor support. For me, the litmus test is whether I can use F2 to rename a variable, and it often does not work inside a Svelte template. There are other places where the editor does not know what to do with your code, because it is not pure JS. Vue is much worse with…
On point 1, this issue is the one to watch. https://github.com/sveltejs/svelte/issues/4518 Language server support will work for both JavaScript and TypeScript and error/type checking and editor support should be pretty comprehensive when it's ready. Svelte 3 was written with TypeScript in mind, so the idioms are fairly compatible with type checking. (a nice pit of success for design!)
This should also fix reassigning to a const mentioned in point 2.
Re: Why Svelte is our choice for a large web project
#107Earlier quoted context omitted.
I've never fully understood this viewpoint, which comes up a lot in relation to React and JSX specifically. The templating in Svelte and Vue is (almost) html with some magic sprinkled here and there, so much closer to the end result. Using JS for everything is moving further away from the metal. What is it about writing views the React way that appeals to you more?
What I found on several consecutive projects was that less the HTML generation resembles the final HTML, the harder it is for people to keep the CSS selectors wired up correctly. Getting text into the page as fast as possible at the cost of layout issues is a sucker's bet. You can't ship until it looks good, and the longer features are in-flight the worse management feels about the team's abilities.
Re: Why Svelte is our choice for a large web project
#108Earlier quoted context omitted.
Same. I haven't done frontend work for a job for about a decade, but kept up to date with things like Angular/Vue/React. I was recently vountold by my wife to create a reunion site for her class. I looked up "barebones front end frameworks." Anything that began the "Getting Started" page with "npm install" I noped out of there. I ended up with Skeleton/jQuery for the front end and PHP Slim for the backend. This is a…
Someone on HN recommended it to me before, so I’ll just pass this along: look at intercooler JS for making individual “live widgets” on a well-designed graceful degradation site like you describe.
Re: Why Svelte is our choice for a large web project
#109The lack of a large and mature ecosystem would prevent me for starting a "large" web project. Svelte is still missing UI frameworks like Material UI or Vuetify. Won't you need date range picker ? Full powered data-tables ? Treeview ? Advanced cards or other layouts ? Awesome effects / styles for a rich UI ? Svelte Material UI is a start : https://sveltematerialui.com/ But I will definitely give Svelte a try for my ne…
https://github.com/6eDesign/svelte-calendar
As for the other components, as the ecosystem grows, these things start to appear. The advantage to Svelte is that it's super-easy to integrate any vanilla component into, much more so than other frameworks. You can totally do away with nonsense wrapping projects, and just add the component verbatim.
Re: Why Svelte is our choice for a large web project
#110I dislike the templating pseudo language of Svelte (and many view frameworks). Maybe I am spoiled by react but I never ever want to write my view logic in anything else than JS. This is my main blocker for Svelte.
I've never fully understood this viewpoint, which comes up a lot in relation to React and JSX specifically. The templating in Svelte and Vue is (almost) html with some magic sprinkled here and there, so much closer to the end result. Using JS for everything is moving further away from the metal. What is it about writing views the React way that appeals to you more?
JSX is JS thus it's powerful. I prefer to use JS to "sprinkel the magic", rather than using yet another (awkward) template language. Using JS for everything is keeping my mental consistent. I enjoy getting full editor support for the entire app (typing (via TS), warnings, auto-suggestions, etc...). Overall it feels more consistent, more composable and more functional (as in Functional Programming) to me.