And it shouldn’t come as a surprise. Once you learn a specific framework (or library, in the case of React), you know the ins and outs of it. You learn how to get things done in an efficient manner. You pick up the tips and tricks for fixing issues.
Of course, that was the case for frontend engineer, Jack Penhale.
Now, he may be a bit of a “Jack of all trades” when it comes to frameworks, but Jack also has a favorite, which is React. Most of what he builds is with React. However, this time around we asked him to step out of his comfort zone a little bit and use Svelte to create an Arcade.
But first, what makes React so great?
React and Svelte popularity
Interestingly, though, there’s a newcomer on the scene in SvelteJS.
Svelte was released in 2016 by Rich Harris and has been adopted by a great group of massive companies like Apple, Square, Spotify and more. And according to that same survey by Stackoverflow, Svelte is now the No. 1 most-popular framework out there. In fact, 71.47% of developers love using it.
What makes both Svelte and React similar are the wonderfully interactive, dazzling sites they can build. But it should be noted that the average app size when using Svelte is a mere 1.6Kb, whereas the smallest one can make a React app is 42.2Kb, which is with ReactDOM.
What does that mean in simple terms?
Svelte is what we consider “lightweight”, and it helps sites using it run incredibly fast. Where the performance of a React site is strong, Svelte sites are another step up into the “great” category.
Why he used Svelte instead of React
One of the reasons he used Svelte was because of its high-performance ability, as referenced above. He wanted a lightweight option which could run games in the browser with ease.
Jack designed the carousel-style display, as well as the landing page for all the games.
Of course, that’s part of the brilliance of micro frontends: Developers can use whichever frameworks, libraries or static site generators they want to build websites.
“With Fathym micro frontends, no matter what page on your site you can choose the framework you want,” Penhale explained. “If you wanted to make a landing page like I did here in Svelte, you could. Then you could write your docs using Docusaurus and launch an e-commerce store using React. The freedom to do all of that is nice, especially when you work in a team where individual devs have preferences for different frameworks.”
What the React developer liked about Svelte
Many in the developer community have raved about the shallow learning curve of Svelte, as well as its being lightweight in design. That’s a big reason why so many who have heard of the framework want to try to use it, as the following graphic illustrates.
Of course, since it was a new framework to him, there were some hurdles with using Svelte.
“One challenge I found is when to break my project into smaller components,” he said. “It was easy to just keep everything on one page until my main file was 500 lines long. Approaching this again I would have a more component based view.”
But, where there were challenges, the strong and extensive Svelte community helped him get back on track.
“A surprise I had with Svelte was how active the dev community is around it,” Penhale explained. “I was worried about not having a MUI component library, there was already one out there in Svelte Material UI. Any questions I had could be easily answered in the docs or on Stackoverflow.”
So, if you’re a new developer or a seasoned veteran, Fathym’s micro frontend architecture can help you in many ways.
First and foremost, it may be your initial foray into micro frontends. Once you give them a try, you may just fall in love with the simplicity of being able to use multiple frameworks and static site generators together.
Join Fathym today for free and scale up to a paid subscription when the time comes.
Top comments (18)
Yet to hear many negatives about Svelte everybody who uses it seems to think its great.
True its still the new kid on the block and the ecosystems is growing plus there are not many jobs available for it yet. But in terms of codebase people have been saying that the syntax is much easier to write.
I'm currently learning and evaluating front end frameworks for my company so we can make a commitment to modernization and attract and retain good front end developers. I'm looking at React, Angular, Vue and Svelte.
From my understanding, I think react needs a package for everything. Because of the virtual DOM, 'normal' JS libs don't work and thus the logic has to be ported/translated through react dom. Svelte in contrast uses the real DOM, so you can import from many/any existing js library and use them. Lots of libs have you call a function with a selector or element as a parameter to use as the root and then inject all of their particulars from there and that works in svelte. You may have to use lifecycle events in the component to perform the setup, where you'd otherwise use a loaded event and the styles might need a little extra hand holding, but it seems relatively straightforward so far.
Maybe worth giving it a shot! Thanks for reading and commenting. Cheers.
I remember when it was first released it was not that big back then. But now there is more reason to learn it so yes.
Svelte is worth it and I love how easy it is too, learning curve isnt steep at all.
For someone who is new in frontend development it was easier to try out Svelte.
And Thanks for this beautiful article🤗.
Thank you, MaadMat! Happy to hear you have a similar experience with it having not too steep a learning curve.
I never read this kind of articles.. but I love this one, thanks
Thank you, Nicolas. What do you think made it different from articles like this one?
I don't know, but I think I read it because of the title 🤔
I think I am a fan of svelte for most cases. But really tied. Both have interesting solutions.
Is progressive web app definitely what you meant?
As far as I understand PWAs make use of service workers, smart caching, offline capabilities where possible. But they do need JS
Very valid points otherwise, I appreciate your point about TS to Web Assembly.
I have no idea why I read this ad.
Indeed. Probably the most egregious is this:
"One of the reasons he used Svelte was because of its high-performance ability, as referenced above. He wanted a lightweight option which could run games in the browser with ease."
...No it isn't. They said so earlier in the article, he used Svelte because THEY ASKED HIM TO. You can't assign someone a development framework and then pretend they chose it for technical reasons.
Well, good point. But he was asked to use it because it is lightweight. He/we wanted a lightweight option, which is why Svelte was used.
Sorry if that wasn't clear. Should be noted the article was changed a bit before publishing to sound less like an "ad" and it could've been clearer on my end.
Appreciate the read! Sorry you think it was an ad.