
Sapper – Progressive web apps powered by Svelte - octosphere
https://sapper.svelte.technology/
======
rich_harris
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-...](https://svelte.technology/blog/sapper-towards-the-ideal-web-app-
framework)

~~~
rajangdavis
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.

~~~
tropshop
You might be interested in [https://markojs.com](https://markojs.com)

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.

~~~
gitgud
Wow that looks cool, their benchmark's blow react and vuejs out of the water
too!

------
bastawhiz
"Military-grade progressive web apps" The "menu" button in the upper left
doesn't work on my phone, so it seems to check out.

~~~
guiomie
What do they mean by 'military grade' ?

~~~
pier25
It's a joke. Sappers are combat engineers.

[https://en.wikipedia.org/wiki/Sapper](https://en.wikipedia.org/wiki/Sapper)

------
arxpoetica
Sapper user here. I've been building a project with it, using it for about 6
mos. and really putting it through its paces. For a project still in active
development and undergoing a lot of changes pre-version 1, I've been extremely
pleased with just how little I've had to think about stability and other back-
to-front-end concerns.

For the “yet another new js framework” people out there, in some ways, it's
true that Sapper isn't necessarily bringing anything new to the landscape
(though I have been very pleased with some of the best-practices adopted-- so
much is so-well thought out, and Rich Harris is just a freakin' genius at web
systems engineering).

BUT

The combination of ingenuity with what Svelte does is completely novel, and in
that sense, Sapper is really a different beast-- not just another framework.
In that regard, one can't really talk fully about Sapper without also talking
in depth about the novelty of Svelte, the "disappearing framework."

The "what" and "how" of Svelte (and Sapper) have been nicely covered elsewhere
(article above, for example), so I won't really touch too much on it. But, as
a non-n00b in the Internet landscape, I'll just throw out this hyperbole:
there really hasn't ever been anything like Svelte and it's pre-compilation
process before in front (and back) end technologies, and it's really just a
full on joy to work with it.

If you want to get a quick taste, just go check what we Svelters like to say
is one of the best kept secrets on the Internet, the Svelte REPL:
[https://svelte.technology/repl](https://svelte.technology/repl)

------
zeroxfe
Just want to point out: "military grade" has negative connotations in tech. In
security and cryptography, the term is a strong indicator of snake oil.

~~~
rich_harris
We might change it. There's an issue open if anyone is motivated to comment
[https://github.com/sveltejs/sapper/issues/263](https://github.com/sveltejs/sapper/issues/263)

~~~
somenewacc
Perhaps you just need to make the Sapper -> military pun more obvious (my gut
feeling was that it was just some ridiculous marketing)

------
orbifold
I associate the military with wasteful resource management and glacial
innovation speed. The military in my country courently does not have working
helicopters (they ran out of spare parts) and the rifles they use overheat and
bend in combat..

------
padraic7a
Military grade? What do they do, steal all your processor resources, blow up
your hard drive and waste all your ram?

------
mephitix
Maybe off-topic but the website is noticeably faster than the Svelte guide
([https://svelte.technology/](https://svelte.technology/)). Is it built on
Sapper itself? Or is it just a static site?

~~~
rich_harris
Both sites are written in Sapper. The difference is that the Sapper site can
take advantage of Sapper's `export` feature, which generates a static site
from your codebase, Gatsby-style (except with much less JS). That's probably
why it's faster for you (though there'd be less of a difference if I was
better at devops)

------
fareesh
Would love to try this. Is there some kind of open-source kitchen sink
application that outlines best practices for concepts like:

\- Internationalization

\- Handling auth w/ SSR

\- Server side pre-rendering (in case I want to pre-render a template and
conditionally cache/expire the HTML for N hours, for better perf instead of
rendering on each request)

\- SEO / Helmet type stuff

~~~
rich_harris
We haven't yet developed a full set of best practices around i18n, but the
SSR/SEO stuff comes for free with the Sapper model. See
[https://github.com/sveltejs/realworld](https://github.com/sveltejs/realworld)
for an auth example - better and more self-explanatory ones to come (project
is still in early stages)

------
peter_retief
First reaction, very nice, I spent about a year on vuejs but I missed the
structure of django. This looks promising, only had a quick look, will write
something small to get a feel for it. Heard of Svelt quite recently through
recommendation

------
k__
How does this work? Like Prepack?

------
gcb0
> runs in build time

> site is blank without javascript

:-/

------
la_fayette
does the world really need another js framework?

~~~
jchw
The same question would have been valid during the creation of React, or
Webpack. People create new frameworks and tools to try to solve pain points,
sometimes they're runaway successes like React or Angular 1, sometimes they're
good complimentary tools like Vue.js, and sometimes they fall completely flat,
like perhaps Batman.js. Either way, the question of whether we need a new JS
framework is not very productive. The right question would be, what can a new
JS framework offer that would be worth switching to it for? The answer will
differ per team and application.

