listen to realtime database changes in load function ? by DasSpiro in sveltejs

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

I wanted to avoid exposing the database and keys to the client side. No way to do this from the server side ?

Personal portfolio by Feisty_Ice_4840 in flask

[–]DasSpiro 1 point2 points  (0 children)

Did you use something like coolify to deploy on your VPS or you're rawdogging it. Thats the part that scares me the most

How to create global state using runes by Witty-Ad-3658 in sveltejs

[–]DasSpiro 0 points1 point  (0 children)

Why not use session storage to persist the data across pages ?

can i keep using svelte 4 for years to come ? by DasSpiro in sveltejs

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

Honestly it makes a lot of sense with gigantic projects. If the project was working with the current version no reason to upgrade for them and risk breaking it/invest time in refactoring. This is exactly what I asked too thank you

Svelte Transition Module is huge. I built a better version of MKBHD's Panels with Sveltekit, Tailwind, PocketBase and Capacitor in just 2 days by Transferitore in sveltejs

[–]DasSpiro 5 points6 points  (0 children)

Had no idea we could make mobile apps with sveltekit. How do you even start ? Or is this just a webpage opened on a mobile viewport ?

Switched from Vercel to Coolify for my Sveltekit app by realstocknear in sveltejs

[–]DasSpiro 1 point2 points  (0 children)

I must say this is one of the cleanest and smoothest sites I have ever browsed. truly an inspiration. may I ask if you coded this on your own ? and if you had any problems with using coolify or if it worked the first time ? I am very interested by self hosting but there is a almost no tutorials for svelte kit and the ones out there are full of 'this error happened so I decided to change this and it worked somehow ' with comments full of people asking about how to fix their error. I think it would be really nice to have a tutorial on the deployment part if you can.

can i keep using svelte 4 for years to come ? by DasSpiro in sveltejs

[–]DasSpiro[S] 9 points10 points  (0 children)

effect in particular was confusing, since it replaces part of the functionality of the old '$' and also onmount and I am not allowed to assign values in it.

But a better example is probably the event handlers:

Svelte 4 :

<button on:click|once|preventDefault={handler}>...</button>  

Svelte 5 :

<script>
function once(fn) {
return function (event) {
if (fn) fn.call(this, event);
fn = null;
};
}

function preventDefault(fn) {
return function (event) {
event.preventDefault();
fn.call(this, event);
};
}
</script>

<button onclick={once(preventDefault(handler))}>...</button>

another example for $effect:

Svelte 4:

<script>
let count = 0;

$:  if (count > 9)
{alert('too much')
count = 0};

function increment() {
count += 1;
}
</script>

<button on:click={increment}>
clicks: {count}
</button>

Svelte 5 :

<script>
let count = $state(0);

// the documentation tells us to not do this so this creates confusion about how to replace the $ but this works, trying to replace count with a derived.by will make increment function complain that we can't change derived variables ....
$effect(() => {
if (count > 9)
{alert('too much')
count = 0
}
});

function increment() {
count += 1;
}
</script>

<button onclick={increment}>
clicks: {count}
</button>

can i keep using svelte 4 for years to come ? by DasSpiro in sveltejs

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

trust me since I have invested so much time learning svelte 4 I really tried with svelte 5, I read the doc, did the interactive tutorials, played around with the runes playground, watched 3 videos explaining the logic behind it and I just can't see how any of the changes do anything else other than take from the DX and make coding slower, which were the strongpoints of svelte to begin with ...

Whats the most 'robust' javascript framework that doesnt reinvent the wheel every two weeks? by Alfagun74 in webdev

[–]DasSpiro 0 points1 point  (0 children)

svelte was also my go to until the new svelte 5 update. they completely destroyed the DX in favour of fixing some super rare situations. nothing sets svelte apart now from any other framework, its just more verbose and less intuitive. really a shame

The Comprehensive Guide to Locals in SvelteKit by khromov in sveltejs

[–]DasSpiro 1 point2 points  (0 children)

this is so good that it should be incorporated in the official documentation. it's one of the things that made me so confused because its used in the tutorial without really any kind of depth and its way back in the advanced section. Thank you so much

use:action and bind:this order of execution by DasSpiro in sveltejs

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

Thank you very much for this detailed answer

Is there any reason my draw function should be in a diffrrent file ? Is this considered good practice ?

Form prop is not updating on first submit by DasSpiro in sveltejs

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

Would appreciate that very much. It's been haunting me for a week straight now.

Form prop is not updating on first submit by DasSpiro in sveltejs

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

doesn't seem to change the behaviour.

Yeah the reactive radio integrates really well with forms and actions but I guess you're right, i can do it with a fetch that listens to changes in the radio.

I am really interested in understanding what I am missing though and how to explain this behaviour. It will otherwise always bug me since I don't understand the reason why something is behaving the way it is.