21 ms·
SvelteKit Is in Public Beta
- chovybizzass 6y agoabout time.
- dang 6y agoWe've banned this account for posting a huge number of unsubstantive comments. That's not what HN is for. It's supposed to be for thoughtful, substantive conversation and intellectual curiosity. If you don't want to be banned, you're welcome to email hn@ycombinator.com and give us reason to believe that you'll follow the rules in the future. They're here: https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html.
- runawaybottle 6y agoI’d like to know what he/she said, given it was their digital last words on the site.
- the_duke 6y agoYou can enable display of dead/flagged comments in the settings.
- spurgu 6y agoHaha thank you kind stranger! I've been a member since 2012 and while I've visited my profile tons of times, for checking comments and submissions, I've apparently never stopped to look at the settings and what they might do. I have a userscript that makes the main view 69ch wide and blurs my username, but I've never even been aware that the site actually has its own customization settings. :facepalm:
- the_duke 6y agoWith pleasure. FYI: [dead] means the account is (shadow)banned, while [flagged] just refers to the particular comment.
- miltonsopus 6y agoIt said "about time."
- runawaybottle 6y agoAnd why did this warrant death? Just so everyone knows, few people even give a fuck about Svelte. Let’s not be babies.
- aidos 6y agoIn isolation, maybe it doesn’t, but reading through the comment history, the site will be better without these contributions.
- runawaybottle 6y agoThat’s up to us to decide. I have said some pretty insane things, and I often don’t get downvotes. If we reach scale, HN is doomed in general. Until then, we should pick the organic route. Most people are lurkers, so if they even had something to say, it would be one liners.
- dang 6y agoModeration is part of HN. That's one reason why being "doomed in general" hasn't yet destroyed the site after 10+ years of "reaching scale" (https://hn.algolia.com/?dateRange=all&page=0&prefix=false&sort=byDate&type=comment&query=stave%20by:dang https://hn.algolia.com/?dateRange=all&page=0&prefix=false&so...). Part of what moderators do is ban accounts that break the site guidelines repeatedly, especially when they are respawns of previous accounts that broke the site guidelines repeatedly.
- Xevi 6y agoI think the point was that the user's comments didn't add much value to the site. If you don't have anything of value to say, then don't say it. Reddit is probably a better platform if you just want to say "nice", or something.
- wirahx 6y agoFWIW this person is also banned from the Svelte github and the Svelte discord for similar behaviour.
- davidwparker 6y agoSelf promotion: For those interested, I did a video tour of the examples provided with SvelteKit (38 minute) - https://www.youtube.com/watch?v=qmwJTI-vH6w https://www.youtube.com/watch?v=qmwJTI-vH6w Definitely a little rough around the edges (the real-world application has bugs), but it is public beta, so it's not surprising.
- deleted 6y ago[deleted]
- pablodavila 6y agoHey I hope you don't mind a bit of constructive criticism: you should look into getting a pop filter for your mic. I'm very sensible to pops and esses so it might not bother others but it's a very cheap upgrade that you might want to consider :) You can also experiment by placing at a 45°angle (point the mic towards your mouth, not your mouth towards the mic) and placing it slightly sideways. It'll help with sibilances and pops. Anyways, thanks for sharing the video, I was actually looking for an overview of SvelteKit's features.
- spurgu 6y agoJust to provide some balance to the argument, the popping doesn't bother me the slightest. :) But yeah, putting the mic angled on the side would probably be an improvement.
- davidwparker 6y agoThanks for the feedback- I'm always looking to improve (I just bought a new webcam). I'll look into a pop filter today!
- kevinak 6y agoThis is so exciting! Been using SvelteKit this last week to build a new version of the Svelte Radio podcast website. Works very well and the DX is amazing. Can't wait for whenever a Cloudflare Worker adapter is out!
- pspeter3 6y agoVite seems to be powering many of these meta frameworks. Will it be the new Webpack?
- qbasic_forever 6y agoNo, go back about a week to the thread here on esbuild: https://news.ycombinator.com/item?id=26399377 https://news.ycombinator.com/item?id=26399377 Esbuild is a go-based tool that takes the place of babel, webpack, tsc, etc. and is much, much faster than webpack. Vite adds a nicer dev experience on top of esbuild (hot module reloading, etc.).
- msoad 6y agonot tsc. There has been attempts to build a faster tsc but I have not seen any results yet.
- wirahx 6y agoI think there is a faster TSC, I forget what it's called, but it's significantly faster. It just isn't as fully fledged as TSC.
- jiofih 6y agoIt takes the place of TSC as a compiler which is a significant speed-up. You still need tsc for the actual type-checking.
- searchableguy 6y agoI only know of one active attempt at: https://stc.dudy.dev/docs/status https://stc.dudy.dev/docs/status from the author of swc. You may ask kdy to test but the product is closed source unlike swc.
- himujjal 6y agotalked to the author on mail. it will remain a closed source product
- sdwvit 6y agoI have a suspicion that svelte may die soonish. Please tell me I am wrong here. All the news I hear about svelte is “something new is released”, instead of version release with bug fixes.
- m8s 6y agoOut of curiosity, how does SvelteKit differ from Sapper? I haven't been involved with Svelte for some time. Looks cool by the way, I think Svelte is a really great product.
- rich_harris 6y agoThis blog post gives a bit more information on that: https://svelte.dev/blog/whats-the-deal-with-sveltekit https://svelte.dev/blog/whats-the-deal-with-sveltekit, though the section on Snowpack is out of date. Basically, SvelteKit is serverless-first (whereas Sapper made you choose between a Node server and prerendered HTML), and because it's powered by Vite has a much nicer developer experience. It also fixes a few of the rough design edges in Sapper. This migration guide gives you an idea of the scope of the changes: https://kit.svelte.dev/migrating https://kit.svelte.dev/migrating
- pier25 6y agoHey Rich, is partial hydration on your roadmap for SvelteKit?
- rich_harris 6y agoThat's a Svelte issue rather than a SvelteKit issue. It's on our _radar_, though I don't know if I'd say it's on our _roadmap_ just yet
- swyx 6y agoi would also like this. i recall Rich musing on some of the "hydrating unnecessary content" problems in this post https://dev.to/richharris/in-defense-of-the-modern-web-2nia https://dev.to/richharris/in-defense-of-the-modern-web-2nia so i imagine its on his mind. Elder.js solved it in a way, i'd love to see Rich's spin on it.
- m8s 6y agoOh, awesome, thanks for responding. Excited to give SvelteKit a try!
- 6y ago
- continuational 6y agoForgot to mention what SvelteKit is...
- koboll 6y agoIt's like the officially-supported Svelte equivalent of Next/Gatsby/Nuxt/etc.
- spurgu 6y ago> If you have a app that you'd like to migrate to SvelteKit, you'll find instructions at . Ok can't copy/paste anchor text apparently, but yeah I'm confused as well. I just read a bit about Sapper the other day, is this a replacement? :shrug:
- swyx 6y agoyes it is a replacement. bunch of internal reasons, but everyone is onboard.
- darkhorsematt 6y agoIt is the new Sapper, yep. Don't shrug, this is he most exciting framework I've seen in 22 years of fullstack dev. Sapper was awesome, and I fully expect SvelteKit to raise the bar even further.
- SiVal 6y agoWhat is SvelteKit? The linked page assumes I already know and have just been waiting for an announcement. I have heard a bit about Svelte. I love the analogy with spreadsheets, where original spreadsheets reevaluated every cell whenever any cell changed. Modern spreadsheets maintain a dependency graph, so when something changes, only the direct dependencies are even evaluated. If any of them change, then only their dependencies are evaluated, etc., recursively. So React's repeated full virtual DOM diff at runtime vs. Svelte's focused dependency graph, created at compile time. Very interesting. But that's Svelte, or at least I think it is. So what is SvelteKit?
- thitcanh 6y agoFor anyone interested, follow the first link in the announcement and read the second section, named What is SvelteKit?
- swyx 6y agoHere's the blogpost from a few months ago: https://svelte.dev/blog/whats-the-deal-with-sveltekit https://svelte.dev/blog/whats-the-deal-with-sveltekit TL;DR, it is the new officially recommended way to build apps with the Svelte framework. Compared to its predecessor, it promises much faster local development based atop Vite and ESBuild, and it can be deployed as a static site, or a node server, or as serverless functions (whereas previously you only had either server or static site options). There are a ton of other small new features as well in the docs.
- pier25 6y agoIt's an application framework for Svelte which replaces Sapper. It uses Vite[1] for development and has been designed from the start to be able to produce static sites a la Gatsby or Next (Sapper wasn't great at that). Svelte Kit runs SSR on Node JS servers like Sapper did, but also on cloud functions and I think even Cloudflare Workers which do not run Node. [1] https://vitejs.dev/ https://vitejs.dev/
- skybrian 6y agoThat doesn't help. What is Sapper? This is defining web tech in terms of other web tech.
- idreyn 6y ago> Even though it was far from ready, SvelteKit was the only framework that matched our esoteric requirements. (Anyone who has worked in a newsroom and done battle with their CMS will know what I'm talking about.) I would be interested to hear more about the esoteric requirements; whether they're performance-related, have to do with what's representable in the CMS, or something else. At any rate, those NYT covid tracker pages are great and I have (sadly) spent a lot of time with them over the past year.
- swyx 6y agoi was surprised to learn how many counties in the US are still considered high risk. also its a pretty cool indication of trust in Rich that they let him build his own metaframework and dogfood it in production at NYT scale. not sure what else i can draw about that (its probably not a good idea to let most devs do that) but its cool
- rich_harris 6y agothings like: • we can't have any dynamic pages, everything has to be static HTML • we don't control the actual page; our job is to create a fragment of HTML that the CMS stitches into the body, then associate that fragment with some publish metadata... • ...but during development, we need a simulacra of the NYT article template • we have to be able to create AMP versions of almost every page • our old app was already fairly Svelte-centric, and we wanted to reuse as much as possible • we wanted to use client-side navigation to avoid page reloads (while capturing custom navigation analytics) e.g. because it makes no sense to make people load MapboxGL repeatedly It's possible that we could have coaxed one of the existing static site generators into fulfilling all these requirements, but it seemed like we'd be in uncharted territory without the benefit of having the SSG maintainer on staff!
- searchableguy 6y agoAre there any plans to support deno?
- rich_harris 6y ago
- jack_riminton 6y agoThe code examples page is a thing of beauty and simplicity, bravo! https://svelte.dev/examples#hello-world https://svelte.dev/examples#hello-world
- karolkozub 6y agoThere's also a tutorial [0] which goes through these examples one by one explaining in detail how each concept works. I highly recommend it to anyone interested in learning this framework. [0]: https://svelte.dev/tutorial https://svelte.dev/tutorial
- iudqnolq 6y agoI don't understand why the second example caches the src, checks if the current src matches the cached src, and if not sets both the src and the alt. Does the complier fully check the codebase to ensure they are always set together?
- nonameiguess 6y agoThis makes me very glad I have never worked in JavaScript. Why does hello world compile to something with three explicit no-ops and what the heck is safe_not_equals? I had to wonder what an unsafe way to determine equality is and looked this and found this is apparently the code? export function safe_not_equal(a, b) { return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); } Why is it possible for a != a to not always be false and b == b to not always be true? How did Javascript defeat the most immutable rule of basic logic discovered by Aristotle 2000 years ago?
- mping 6y agoAlthough I agree with you in principle, in practice most of js devs never worry about such things. It's mostly library authors and such. And there are cases where a != a, I think for NaN (not a number).
- nonameiguess 6y ago
- DrStartup 6y agoWeb dev with Svelte brings me back to the early days of web development - php, MySQL, jquery and XMLhttprequest. I personally have never understood all the tooling required to build a modern day react app, and oh how I have tried. Svelte dev as a way-of-thinking-framework is as close to the fundamentals as I think you can get. The dx is amazing and sveltekit takes it to the next level. #sveltalowda Edit: embarrassing typo
- aembleton 6y agoHow does Sveltekit compare to Elder.js? I've been trying Elder.js out and I really like how easy it is to specify which parts to hydrate. https://elderguide.com/tech/elderjs/ https://elderguide.com/tech/elderjs/
- wirahx 6y agoElderJS is a very specific use-case, which is mass static generation, designed for SEO heavy sites. It's a very narrow usecase. SvelteKit is designed to let you build anything at all with Svelte. ElderJS, JungleJS, Primo etc, are all specialisms.
- darkhorsematt 6y agointeresting distinctions... thanks.
- slim 6y agofrom the documentation: There are two basic concepts: There are two basic concepts: Each page of your app is a component You create pages by adding files to the src/routes directory of your project. These will be server-rendered so that a user's first visit to your app is as fast as possible, then a client-side app takes over looks like you reinvented php, no?
- rich_harris 6y agooh, does PHP include a client-side router these days? that's exciting!
- F117-DK 6y agolol
- jiofih 6y agoNo. PHP hasn’t been “one file per page” in at least 15 years, and that’s hardly a defining trait for either of these two things. If this is your only thought about it, you have a lot of catching up to do!
- qbasic_forever 6y agoLearn more about svelte (not just sveltekit here) and you'll see why your snarky comment just looks dull and uninformed. SSR (what you're calling reinvented php here) is just one tiny part of the svelte and broader component-based client-side JS ecosystem. You're washing away their incredible power for building fully browser-based applications that mix client and server logic all from the same clean codebase.
- benbro 6y agoCan I use it for SPA? Something like an Angular app with all the code running on the client side with routing (no SSR).
- rich_harris 6y agoNot currently, but this will be implemented soon (and certainly before 1.0) https://github.com/sveltejs/kit/issues/231 https://github.com/sveltejs/kit/issues/231
- pier25 6y agoWill SvelteKit follow the same pattern as Sapper? As in, after the first SSR'd page the app becomes an SPA.
- rich_harris 6y agoYes
- darkhorse13 6y agoI simply cannot wait for Svelte to blow up in popularity! It is by far the most promising web technology to me.
- lhenriquez 6y ago+1 I’m building my second app using svelte now and I’ve had a great experience. Svelte gives me what I need without a bunch of cruft that I don’t, and it lets me build components that embed in existing sites really well. The only thing missing was a good server side rendering story which I didn’t need short-term but long-term will be really useful.
- alexandargyurov 6y agoRich Harris did a great talk[0] at an early stage of SvelteKit's development called "Futuristic Web Development". I really do believe this is the next phase of how JS web frameworks will work in the future. [0] https://www.youtube.com/watch?v=qSfdtmcZ4d0 https://www.youtube.com/watch?v=qSfdtmcZ4d0
- thirtythree 6y agoAwesome! I will attempt to migrate from Sapper now
- newsbinator 6y agoOne thing that stops me from moving over to Svelte from Vue is the lack of a Vuetify (component framework with an API & tons of slots) equivalent. That's also what stops me from moving over to Vue 3 (for which Vuetify support is currently in Alpha). Vuetify just makes dev life so much easier. If Svelte had something that deep and all-encompassing I'd go all-in.
- ampdepolymerase 6y agohttps://sveltematerialui.com/ https://sveltematerialui.com/
- newsbinator 6y agoUnfortunately Svelte Material UI is vastly less developed than Vuetify. It’s a huge deficit in components and functionality.
- darkhorsematt 6y agoHave you seen: https://sveltematerialui.com/ https://sveltematerialui.com/
- ajoy 6y agoAgree with this one. Existing UI frameworks (eg. https://sveltematerialui.com/ https://sveltematerialui.com/) are not to the level of Vuetify (for good reason). Even though I like Svelte, having to build a lot of UI elements from scratch has been annoying.
- jefflombardjr 6y agoThis is awesome. Sapper is great, so I'm excited to move over to this.
- darkhorsematt 6y agoLikewise.
- cutler 6y agoState management in Svelte, eg. Redux, looks really clunky compared with React and Vue so I'm afraid SvelteKit is a non-starter for me.
- CaptainCodeman 6y agoYou can just use Redux if you want, but Svelte Stores are significantly nicer and help with focused updates.
- wirahx 6y agoIt's vastly simpler. You should try something before you write it off.
- acoyfellow 6y agoConsidering you can add redux to svelte... This seems trivial.
- arxpoetica 6y ago100% the opposite is true. Svelte stores are extremely elegant and not belabored with boilerplate like Redux.
- raihansaputra 6y agoI decided to use Redux Bundler for a project at work. All the magic defined with Redux, and simple component building with Svelte. No hassle.
- string 6y agoI'm really enjoying front-end work at the moment. I've used Vite/esbuild for a few projects so far and it's a huge step forward, and I'm really excited by this hybrid SSG/SSR approach that SvelteKit is offering, especially as it's "official". I've been primarily a Vue dev for quite a few years and never really considered investing much time in other emerging frameworks, but I'm very tempted to seriously dive into Svelte at this point. JS/front-end often gets a bad rap on HN. I see complaints that things have become unnecessarily complicated or that all these frameworks are overkill, but I can build pretty complex, well structured applications with relative ease these days, and I have way more fun doing it, most of the time. I suppose I owe a lot to people like Rich Harris and Evan You who are genuinely making the work I do more enjoyable. Looking forward to trying this out.
- darkhorsematt 6y agoSvelte rocks, Sapper was awesome, and SvelteKit looks to be even better. Stoked.
- aitchnyu 6y agoWill this support devs who want to use Svelte to add specific widgets to a dynamically generated Rails page? I want to explore SSR but was/is daunting with installing JS stuff along with existing web app infra.
- ajdegol 6y agoSvelte has been such a breath of fresh air after so many years with React. (I still like React.) All my new projects are built with Svelte. There are just a couple of patterns to ease the transition but once you get those it's just so easy. The best part is every time you want to do something, you gradually stop looking for a library to do it, because it's just html, js and css. So you just roll your own solution and everything is much, much simpler. Well as Rich Hickey would say, "not everything is awesome", but I'm a big fan of Svelte and mainly looking forward to the new build times speed increases. Thank you Rich Harris and all the Svelte contributors!