interview with svelte master
ux/dx, rollup, svelte routers, sapper, community, resources, future developments
|Jul 2, 2020|
Svelte Master is a youtube channel dedicated to all things Svelte and covers topics like why Svelte is the best JS framework, routing in Svelte, and other Svelte related projects like Sapper. In this interview we talk about everything going on in the ecosystem and where it’s headed.
You’ve called Svelte “the best framework yet.” That’s a bold claim. Lets here the reasoning.
It comes down to 2 things:
Better UX (user experience)
Better DX (developer experience)
smaller bundle sizes (faster load)
no virtual DOM overhead (better performance)
less code to write (can code faster, happilier, less buggilier)
simpler concepts (same reasoning as above ^^^)
built-in state management, transition and reactivity, simpler forms with binding, components are valid HTML, context is simple, event dispatching, etc..
How can it do this??
Svelte is a compiler so it can add features without adding bloat to the framework.
If you’ve used a component-based framework then Svelte is SUPER intuitive. I’ve only used React and the main weirdness for me was the templating syntax rather than using
.map and JS
if-statements. But I like that part now. It’s definitely more similar to Vue than React.
Svelte comes with Rollup as its bundler by default instead of Webpack. I have a theory that if Svelte continues to rise in popularity this will have a second order effect on shifting the mindshare from Webpack to Rollup simply because developers don’t want to think about tooling and will go with whatever is the simplest default. Have you spent much time configuring Rollup and have you noticed many differences between Rollup and Webpack?
Nooo, I avoid those and just copy-paste when I need to. My impression is that rollup is simpler and faster but I’d be on the lookout for Snowpack! Pretty speedy guy it seems…
(AJC: I definitely have Snowpack on my radar, will probably dedicate a post to it soon along with the whole Pika ecosystem)
There’s always been a big debate about whether frameworks should include their own router or bring in a third party library. For example:
Ember had a tightly integrated router
React had a separate routing package from Michael Jackson and Ryan Florence
Vue seems to have a separate package but it’s referred to as “the official Vue router”
Redwood has written their own router which Tom admits is a very risky move because of the complexity involved
What’s the routing story for Svelte?
I think people want an official Svelte router but there isn’t one right now. These are the main options:
Sapper - The closest thing to “official” svelte router. (see below)
Routify - File-based routing (like Sapper) with built-in page transitions and many other features that are routing-related
Svelte-routing - This is like the equivalent of the react router. (Declarative + need setup for serving an SPA)
Svelte-spa-router - Hash based routing
Yeah it’s more appropriate for building a “real world” (ie, full stack and public-facing) website from scratch. It gives you file-based routing, server-side rendering, code splitting, preloading, API creation, progressive web app features, etc. I would use just Svelte if it’s being added to an existing fullstack project or if your app is not for public eyes 👀.
What’s the community like? Is there a contributors guide? Do you have a code of conduct?
Hmm I mean, I think the community is friendly and not too gate-keepy. But I don’t have much to compare it to. It’s overwhelmingly male that’s for sure. I think people value simplicity which is nice. I hope that it can be a good framework for those without much programming experience.
No CoC. See: Issues #3791
If people enjoy your videos and want more cool Svelte community resources where should they be looking?
Search “Svelte Rich Harris” on Youtube or in podcasts for delightful videos/podcast episodes. I especially like this one:
(AJC: Yes, love that interview and big, big fan of all of Rich’s talks)
Where is Svelte currently lacking, and what can we expect to see on the horizon?
Typescript support will come very soon (or is already here when you read this)!
Not a great story for how to test but you can use cypress or check this out: Svelte Testing Library (I couldn’t get it to work very well…)
Because Svelte lets you do a lot of simple and cool things, there are less guardrails against bad practices.
It’s still a baby so doesn’t have a ton of libraries like React and Vue.
Some people feel like they won’t get hired if they learn Svelte instead of React or Vue but in my experience, 2 things can happen:
You use Svelte in the interview and can do tasks way quicker than if you used React.
The interviewer asks you questions in React and you say something like “oh I use Svelte mostly so I’m kinda rusty in React” and then anything you do is more impressive since you get leeway for not really being a “React person.”
Last question, I’m a huge NLP nerd so even though this has nothing to do with Svelte you studied Computational Linguistics so I really want to hear your thoughts on GPT-2 and in general language models. It seems like we’re still scaling these models up both in number of parameters and size of text corpora. No one knows how far this will go and while I doubt we’ll get to full AGI just with these models they seem to be approaching some kind of general intelligence in terms of their abilities in translation, question answering, and summarization.
RANTY RANT: Yeah NLP has come a long long way for sure. Speech recognition is pretty good now and huge improvements in natural language understanding (NLU). BUT, the reason I’m not into NLP anymore is that it’s so hard to make anything useful. Most examples you see of a language model doing something cool is cherry-picked and when you try to venture outside of it, it breaks down. One thing is that most language models are not built on real conversational text data.
Language is conversation and includes emotion, humor, meta-messages, sarcasm, beliefs, metaphors, references to past conversations, nuance, idiolectal variance, etc. which isn’t easily captured in these models. They mostly just predict the likelihood of words occurring together which definitely has useful applications but isn’t human-like.
Try this: think of some normal English sentences in your mind. Did you do that? Well don’t keep reading until you did that. The next part will be jumbled so you didn’t accidentally read it. Nwo go and raed msegsaes wtih yuor fdneris and see if they are at all similar to the sentences you thought of. In my case, I think of like “Today I’m going to take the day off. I hope the weather’s nice today.” But in my messages I find stuff like “Ohhh yeahhh lay it on me THICC” and “so if i just don't start with them that will be my secret weapon haha”.
The point is, language is weird and conversational and super complex and emotional and nuanced and playful and so much more! But anyway I’m just cynical and don’t get excited by it (can you tell what “it” refers to??) anymore. But there are still great things happening! Just know that it might be more limited than you think :)
Awesome, huge thanks to Noah for indulging my nerdiness and for all the insightful answers about Svelte. If you haven’t ventured into the Svelte world yet I highly recommend doing so as we’ll be seeing a lot more of it in the future. Keep up to date with the ecosystem at Svelte Master’s Youtube channel and @MasterSvelte.