Skip to content

Svelte beggers screwed up. #16350

Closed as not planned
Closed as not planned
@JosepAlacid

Description

@JosepAlacid

Describe the problem

I'm always frustrated when...
Everyone writing docs and tutorials on Svelte needs to relay on references to Svelte < v4 or React.
From the outside, trying to get in, it seems that Svelte is an incredible framework...
... but only if you are already inside or if you came from React.
For people coming from vanilla javascript, typescript, jquery, Angular,... it's like you need to go back in the release tree, learn older versions of the framework and immediately trash all your new knowledge and "migrate" yourself.
All Svelte 5 tutorials (even basic ones, let alone advanced concepts) and most documentation assume you came from react or older versions of Svelte.
It's impossible -for instance- to understand how data is sent back on last version of SvelteKit when calling an enhance function from a form. Even the docs are outdated or "Svelte Experts Only" oriented.

Somewhere it states that data is sent back to the +page.svelte file thru the form "prop", but if you try to declare your props, you'll find some fun surprises:

Here, everything goes well:

    let { data }: { data: PageData } = $props();

and here, it's ok too:

    let { form }: PageProps = $props();

but here you'll start to get some problems

     let { data, form }:PageProps = $props();

because "data" will lose his type and you'll get all kind of errors to a code working well before you try to add "form" to the page.

No clear docs or information anywhere on what's expected from $props(), no example or guide about how to update and get the new data from a simple update to a DB on Svelte 5 or SvelteKit (Svelte5based, v2 or whatever version it is now).

Describe the proposed solution

I would like to see...
... someone on this framework with some pedagogic intention and willing to open the framework to another source of users: those who get into web coding from basic html and javascript knowledge. Not a React or Svelte -4 expert.

Even I tried to be polite, I may have let some frustration to go into my post. But I hope -you reading- will get this claim's root and don't stare at my finger.

I feel a bit better now.

Importance

nice to have

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions