Hey all - Sapper creator here. Wasn't expecting to see this on HN, and not in a position to fully join the discussion (ie I'm in a pub) but happy to answer any questions when I can. This is an early project that is still in very active development (we have some very exciting stuff planned), but for a quick primer here's a blog post that sets out our stall a bit: https://svelte.technology/blog/sapper-towards-the-ideal-web-...
hey rich! i saw your JSConf demo, its a real shame about all the technical difficulties - do you mind do a youtube recording of those parts of the talk again so we can just see what you were trying to demo? really super promising though, and i love your entertaining style. you have a really special combination of talents, thank you for being you.
Is it possible to support functionality where I can have my components and pages written in javascript but be rendered as server-side only?
I like client-side rendering for certain things; however, I don't really want it for every component/view within a javascript framework.
What I want is the flexibility to write declarative components with localized state but only introduce client side rendering when I want to introduce it.
I feel like the universal approach can be a bit heavy handed in that everything is getting rendered both on the server and the client. I would love to have something like Angular 1.* but with more structure and server side rendering.
I used it a few years ago and one of my favorite aspects was using primarily for generating templates server side, and only upgrading to a client component when things became more complex. Out-of-order async rendering was pretty nifty too.
One of the advantages of the Svelte approach is that you can theoretically make those determinations at compile time - if there's no interactivity on a page, don't serve any JavaScript. We're not quite there yet but it's very much on our radar. You should be able to use a consistent programming model whether you're building an app that makes most sense as a purely server-rendered app, an SPA, or something in between - especially since your requirements can change unexpectedly - and if the framework is designed correctly, it shouldn't even require configuration.
I was definitely looking at Svelte, Vue, and React for this.
I played around with Nuxt and couldn't get it to work in a way where I could avoid rendering on the client. It's not a bad framework, but it doesn't work for the purposes that I am looking for.
What I am doing today is using Ruby and Sinatra for the back end. I have figured out a way to build out a light weight component system where this is an html view, some vanilla js for interactivity, and CSS for styling.
The problem is that it is really difficult to localize the scope of the js and I have to work with the DOM to add interactivity. Scoping the CSS isn't necessary but would be nice.
I don't dislike doing things in Ruby, but I am very much attracted to the idea that I can use one language for the server and client logic and avoid having to tap into the DOM for managing state.
Any plans to officially support TypeScript in Svelte and Sapper? It looks like the Svelte compiler and all of Sapper are written in TypeScript, but the Svelte runtime bits aren't. Also, considering that Svelte essentially has its own DSL based on HTML, with inline JavaScript, I guess existing IDE support for TypeScript wouldn't be sufficient. I'd happily take the type checking and extra language features without the IDE support, but I guess I'm in the minority.