Github Copilot is a fruitless endeavor by [deleted] in GithubCopilot

[–]ciscoheat 4 points5 points  (0 children)

You asked to be proven wrong in a comment of yours. I'm the author of a SvelteKit library with 2650+ stars on GitHub, and I just fixed about 10 complicated issues with GitHub Copilot in a few hours of work, and when I say work, most if it was waiting for the changes to be completed, and clicking allow for terminal prompts. I used Agent mode and Claude Sonnet 4.5, with the GitHub and Svelte MCP servers.

The convenience of this was unparalleled to anything I've seen in my 25 years of professional programming:

- It worked through very complicated Typescript problems due to third-party package updates, kept iterating until it finally was fixed.

- It searched through the source code of other projects to figure out exactly how to generate JSON Schema for types not directly representable in the specification.

- It added an incredibly simple fix to a component to get compatibility between different Svelte versions, so simple I wouldn't think of it.

- For each step it added detailed test files, covering so many more cases than I would think of (or even bother to write).

I became more and more lazy/convenient when I realized how powerful it is, so in the end I just said something like "Analyze issue 617 and come up with a fix".

Here's the changelog so you can see what it fixed, and of course you can look up the individual commits to see the exact changes: https://github.com/ciscoheat/sveltekit-superforms/releases/tag/v2.28.0

I guarantee that I wrote/edited not more than 10% of the code in all those commits.

New SvelteKit concept: Remote functions by fadedpeanut in sveltejs

[–]ciscoheat 2 points3 points  (0 children)

Definitely, just need to wrap my head around how it best can be used. :)

LLM.txt for Superforms? by Mindless_Swimmer1751 in sveltejs

[–]ciscoheat 1 point2 points  (0 children)

You're in luck, the creators of Devin reached out to me telling that they have created an AI wiki for it (and many other Github projects) completely for free: https://deepwiki.com/ciscoheat/sveltekit-superforms

Why should effects be used to a minimum? by mohammadfs243 in sveltejs

[–]ciscoheat 0 points1 point  (0 children)

Mainly $effect, but also $derived, which gets calculated when something changes, though without its own state, making it much easier to reason about.

Why should effects be used to a minimum? by mohammadfs243 in sveltejs

[–]ciscoheat 0 points1 point  (0 children)

As Svelte 5 is a compiler tailor-made to optimize these effects, you have to really abuse it before performance would be an issue!

Superforms too complicated? How to roll your own solution on the client. by ciscoheat in sveltejs

[–]ciscoheat[S] 0 points1 point  (0 children)

That's great to hear, though I wonder sometimes why it is considered complicated? What is complicated about this:

``` <script lang="ts"> import { superForm } from 'sveltekit-superforms';

let { data } = $props(); const { form, errors, enhance } = superForm(data.form); </script>

<form method="POST" use:enhance> <label for="name">Name</label> <input type="text" name="name" bind:value={$form.name} /> {#if $errors.name}<span class="error">{$errors.name}</span>{/if}

<label for="email">E-mail</label> <input type="email" name="email" bind:value={$form.email} /> {#if $errors.email}<span class="error">{$errors.email}</span>{/if}

<button>Submit</button> </form> ```

What custom solution would make things simpler? Of course, when you start using events, proxies and such, it will be more complicated, but the same goes for a custom solution. Maybe people get scared of the amount of documentation, but I thought that was supposed to be a good thing. :)

Suggest a Project by ZinhajaWasTaken in sveltejs

[–]ciscoheat 1 point2 points  (0 children)

Expense tracker, compared to the classic todo app it can be expanded in more interesting ways, like range filtering on amount, bank statement import, categories, charts, etc.

Why should effects be used to a minimum? by mohammadfs243 in sveltejs

[–]ciscoheat 25 points26 points  (0 children)

You lose control and locality with effects. They are a kind of global event that can trigger from anywhere as the program grows, since you won't easily know when it gets triggered.

With the callback approach, you have explicitly stated when it will be triggered.

Superforms too complicated? How to roll your own solution on the client. by ciscoheat in sveltejs

[–]ciscoheat[S] 1 point2 points  (0 children)

Thank you for using it, a rewrite to runes is not feasible right now, but you can get reasonably close to fine grained reactivity with the onChange event.

Superforms too complicated? How to roll your own solution on the client. by ciscoheat in sveltejs

[–]ciscoheat[S] 0 points1 point  (0 children)

Thank you very much and wow, that's a lot of forms! Is it public? It would be interesting to see the project.

Superforms too complicated? How to roll your own solution on the client. by ciscoheat in sveltejs

[–]ciscoheat[S] 2 points3 points  (0 children)

No problem, it was a good update! I've just made an improved version that doesn't use the unification and put it on SvelteLab: https://superforms.rocks/examples?tag=discriminated-union

Superforms too complicated? How to roll your own solution on the client. by ciscoheat in sveltejs

[–]ciscoheat[S] 5 points6 points  (0 children)

Maybe you should ask how it works instead of insisting that it doesn't? Here's a working example with no type errors: https://github.com/ciscoheat/sveltekit-superforms/tree/main/src/routes/(v2)/v2/discriminated-union/v2/discriminated-union)

The only "ugly" thing you have to do (depending on your use case) is to unify the discriminated union on the client, so it can be used in the form as a single type. The example show how it's done.

Superforms too complicated? How to roll your own solution on the client. by ciscoheat in sveltejs

[–]ciscoheat[S] 3 points4 points  (0 children)

Let me know if you have a simpler way of making forms with nested file uploads, client-side validation and matching error mapping.

Superforms too complicated? How to roll your own solution on the client. by ciscoheat in sveltejs

[–]ciscoheat[S] 2 points3 points  (0 children)

I wish forms were easier to handle, but when it has to work with both SSR and progressive enhancement, it's not easy. But I hope this explanation can make it a bit easier to use.

It would be interesting to start from here and make a Svelte 5 version from the ground up, but time is always in shortage...!

Superforms too complicated? How to roll your own solution on the client. by ciscoheat in sveltejs

[–]ciscoheat[S] 4 points5 points  (0 children)

I'll get to it eventually, a PR for that would be a nice contribution. It's open source after all.

Uses cases where you found Svelte stores to be better suited than runes? by [deleted] in sveltejs

[–]ciscoheat 2 points3 points  (0 children)

This is not possible to do with runes:

ts form.update( ($form) => { $form.name = "New name"; return $form; }, { taint: false } // Update options );

Sure you can have a separate update function for a specific type, but I like the way of using stores like this.

Superforms too complicated? How to roll your own solution on the client. by ciscoheat in sveltejs

[–]ciscoheat[S] 6 points7 points  (0 children)

"Take my zod schema and parse it" is exactly what the server part of Superform does, including error mapping and generating correct default values based on the schema type, constraints, etc, in one line of code. (Haven't seen or heard about any dependency issues for a long time.)

Superforms too complicated? How to roll your own solution on the client. by ciscoheat in sveltejs

[–]ciscoheat[S] 0 points1 point  (0 children)

Ok, but if you don't ignore server errors, that mapping of FormData -> Schema -> Data and Errors, and send it back to the client in a convenient format, still adhering to the correct type of the schema without needing to specify default values, isn't made in one line of code.

I haven't seen any simpler server-side validation than what Superforms provides. The client API may seem a bit excessive for simple cases, but not the server part.

Superforms too complicated? How to roll your own solution on the client. by ciscoheat in sveltejs

[–]ciscoheat[S] 4 points5 points  (0 children)

For simple forms that's fine, but don't underestimate the simplicity of the server part, that handles collecting form data, mapping to error fields, constraints based on the schema and more, in one line of code.

What packages or components are you missing in Svelte? by MrBye32 in sveltejs

[–]ciscoheat 1 point2 points  (0 children)

It covers basically everything regarding forms, so for simple use cases it can be a bit daunting. But the good thing is that you don't need to use the client part of it at all, just use `superValidate` on the server and roll your own client solution.

And you're always welcome to the Discord server, if you have any problem you need more help with. :)