Earlier quoted context omitted.
I did this - that's part of the 2nd link. Problem is that it didn't work for me. I definitely did something wrong.
Did you use the right command for your npm version? Did the installer work? Or did something go wrong with `npm run dev`?
Svelte 4
191–200 of 227 posts
Re: Svelte 4
#192Earlier quoted context omitted.
One of the things released today was dedicated documentation for TypeScript: https://svelte.dev/docs/typescript . The site was also updated today to include a JS/TS toggle so that you can see all the examples written in TypeScript if you prefer it to JS. I'm not sure how long ago you tried or what issues you ran into, but hopefully this will help with getting started with Svelte and TypeScript much more easily.
> The site was also updated today to include a JS/TS toggle so that you can see all the examples written in TypeScript if you prefer it to JS. Yeah that toggle has been on there for months now actually
Re: Svelte 4
#193Earlier quoted context omitted.
Did you use the right command for your npm version? Did the installer work? Or did something go wrong with `npm run dev`?
Yes, installer worked. npm run dev resulted in a generated index.html not the contents of src/app/App.svelte
I just went through it and there's an important step of changing into the directory created by `npm create ...` (named `my-svelte-app` in the example above) and then running `npm install` inside that directory.
Can confirm it works for me with npm version 8.5.5, node v15.15.0, on a macbook air with an Intel processor.
npm create vite@latest my-svelte-app -- --template svelt
cd my-svelte-app/
npm install
npm run dev
Started up the dev server, made a change in the App.svelte, and could see it reflected in the browser immediately.Re: Svelte 4
#194Earlier quoted context omitted.
It's the opposite for me. React can be verbose but that's because a lot of it is explicit and has escape hatches. Svelte has magic that works until it doesn't and then you're stuck in Svelte land. It's not "just JS" despite people marketing it as such
I was stuck once by abusing `bind:` and other time with global exit transitions + sveltekit routing, but that's about it. React on the other hand feels like a pot warming up and we're the frogs being boiled alive at this point. You can write some perfectly valid, but naive React code and it's going to have some footguns. We're so used to write idiomatic React code we don't even notice that anymore. You learn to use s…
Re: Svelte 4
#195Time for a very naive question. As somebody looking for a more effcient (less re-rendering) and nicer DX (template based, stuff like exit animations) alternative to React, what actually makes Svelte measurably better than Vue? On first (and very naive) look the two seem pretty similar, with the biggest difference being that Vue seems to have the much bigger ecosystem and more mature tooling (I keep hearing about Svel…
> I keep hearing about Svelte's flavor of JS basically being its own language now and it not playing all that well with Typescript it's a weird habit on HN to refer to random rumours that have discouraged you from trying something, and then explicitly not link to even the source of the random thing you're thinking of. I would guess you're misremembering something about the *developers of Svelte* saying they didn't th…
Re: Svelte 4
#196Time for a very naive question. As somebody looking for a more effcient (less re-rendering) and nicer DX (template based, stuff like exit animations) alternative to React, what actually makes Svelte measurably better than Vue? On first (and very naive) look the two seem pretty similar, with the biggest difference being that Vue seems to have the much bigger ecosystem and more mature tooling (I keep hearing about Svel…
Not diffing at all against a virtual DOM and instead executing the pre-compiled DOM manipulations is an order of magnitude better in terms of processing. It also avoids diffing entirely. At a casual glance, the compiler hints and other VDOM optimisations in Vue reduce but do not obviate this burden (e.g., don't re-render static nodes, flatten the DOM tree to avoid traversing) But as ever, it's best to measure these things and I can't seem to find any recent benchmarks between the two platforms, and any benchmark would vary wildly depending on use-case, and with the exigencies of real-world development.
Re: Svelte 4
#197Earlier quoted context omitted.
Vue dropped "reactivity transform" but they are working on a new "Vapor Mode" which is inspired by SolidJS, i.e. not having a VDOM. https://blog.vuejs.org/posts/2022-year-in-review
Thanks for the link! > Vapor Mode will only support a subset of Vue features. In particular, Vapor Mode components will only support Composition API and . However, this supported subset will work exactly the same between Vapor and non-Vapor components. > Building an app with only Vapor components allows you to drop the Virtual DOM runtime from the bundle, significantly reducing the baseline runtime size. This seems l…
Re: Svelte 4
#198Re: Svelte 4
#199To be more exact on what I want to do: is a dynamic dashboard, where users can add widgets or/and resize them per needed.
Re: Svelte 4
#200> Svelte 4 reduces the Svelte package size by nearly 75% (10.6 MB down to 2.8 MB), which means less waiting on npm install. This improvement will be especially noticeable for users who are loading our interactive learning experience on learn.svelte.dev for the first time, users of the Svelte REPL, and users with limited connectivity. The majority of the remaining package size is eslint support, which necessitates dis…
I remember when I was talking about some code my team wrote once and we'd managed to get an operation down from 6 hours to like 5 minutes. Another manager said to me (fairly with hindsight) "If you get something down from two hours to one hour, that's an opimisation. Going from 6 hours to 5 minutes means it just wasn't finished."
Sorry, HR rep, I thought we were just slinging pithy aphorisms!