Live data from Hacker News

SvelteKit Is in Public Beta

svelte.dev

101–110 of 119 posts

Re: SvelteKit Is in Public Beta

#101
post #23

Forgot to mention what SvelteKit is ...

> 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:

It 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.

Re: SvelteKit Is in Public Beta

#102
post #88

State management in Svelte, eg. Redux, looks really clunky compared with React and Vue so I'm afraid SvelteKit is a non-starter for me.

I decided to use Redux Bundler for a project at work. All the magic defined with Redux, and simple component building with Svelte. No hassle.

Re: SvelteKit Is in Public Beta

#104

The code examples page is a thing of beauty and simplicity, bravo! https://svelte.dev/examples#hello-world

This 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?

Re: SvelteKit Is in Public Beta

#105

Earlier quoted context omitted.

Added a paragraph to the blog post: > Think of it as Next for Svelte. It's a framework for building apps with Svelte, complete with server-side rendering, routing, code-splitting for JS and CSS, adapters for different serverless platforms and so on. > If you're familiar with Sapper, SvelteKit is Sapper's successor.

As @skybrian points out below, this doesn't help much if you don't know what Next and Sapper are, and especially if you don't know what Svelte is. Here's my attempt. 1. Svelte is a JavaScript component framework, i.e. it offers a way to write reusable UI components in JavaScript. (Other popular frameworks include React, Angular, and Vue.) Each major framework solves the problem of code reuse in a different way, and c…

That was outstanding. Decades ago, before they invented juice boxes, we kids enjoyed milk and cookies while listening to carefully worded, age-appropriate explanations. Heaven help me, sometimes that combination still hits the spot. Thank you.

Re: SvelteKit Is in Public Beta

#106
post #22

What 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 d…

Interestingly Clojurescript had such a web framework far before Svelte: https://hoplon.io/

Re: SvelteKit Is in Public Beta

#107
Will 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.

Re: SvelteKit Is in Public Beta

#108

The code examples page is a thing of beauty and simplicity, bravo! https://svelte.dev/examples#hello-world

This 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…

Although 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).

Re: SvelteKit Is in Public Beta

#109
post #63

Earlier quoted context omitted.

That doesn't help. What is Sapper? This is defining web tech in terms of other web tech.

See Svelte as a JavaScript library like React or Angular, which allows you to develop web applications easily. Now, SvelteKit is bringing the library to the _framework_ level (big big emphasis on "framework", we all have different definitions for what a framework is), which adds easy routing, server-side rendering, optimized JavaScript bundles per page for the client, etc.

Bit of a nitpick, but wouldn't the comparison be SvelteKit as similar to Angular, and Svelte similar to React?

Re: SvelteKit Is in Public Beta

#110

The code examples page is a thing of beauty and simplicity, bravo! https://svelte.dev/examples#hello-world

This 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…

Javascript does a lot of implcit conversions, it was badly designed and has dynamic types which means a lot of runtime checks, these quirks can't be removed with breaking a lot of legacy code.

Unsafe equality: "1" == 1 is true (string and float, https://dev.to/mkrl/javascript-quirks-in-one-image-from-the-...).

Yet, like with C, you learn the different ways you can shoot yourself in the foot over time and avoid them. In 10 years I've never written a safe_not_equals function, although explicit object/null checks are a thing, but it wouldn't surprise me if libraries used by millions that may end up in Internet Explorer go that extra step. Each language has it's particular use-case, JS happens to be the language of web development.

Post reply on HN