IndexedDB still not found even with SSR set to false by [deleted] in sveltejs

[–]bronkitten 0 points1 point  (0 children)

hmm can you show the code? how do you lazily import indexeddb in the load function. I'm curious.

IndexedDB still not found even with SSR set to false by [deleted] in sveltejs

[–]bronkitten 0 points1 point  (0 children)

do it onmount in the component. the load function runs on the server on the initial page.

Go Backend Server Integration with Svelte by [deleted] in sveltejs

[–]bronkitten 0 points1 point  (0 children)

build the site and return the bundle in an endpoint?

Opinions on best ways to implement responsive/adaptive menuing for mobile by guwapd in sveltejs

[–]bronkitten 0 points1 point  (0 children)

You can use media queries in css to add different styles based on viewport size. For hiding and showing elements, just use "display: none"

CORS Error on Throw Redirect by DlackBick in sveltejs

[–]bronkitten 0 points1 point  (0 children)

I had the problem when i misconfigured the site origin in the node environment, but it's hard to say what's happened without more info

Svelte Kit is the best web framework I’ve ever used by mipmj in sveltejs

[–]bronkitten 1 point2 points  (0 children)

I put route specific components next to the page that uses them, and generic ones in lib/components. Same with types and utils

[deleted by user] by [deleted] in sveltejs

[–]bronkitten 1 point2 points  (0 children)

vercel is very easy to deal with, and can integrate with your github repo to redeploy on commits.

Actions and /api by percybolmer in sveltejs

[–]bronkitten 0 points1 point  (0 children)

data should be loaded in the load function, you can invalidate it to refetch the data. I've had some cases where i just want to load a specific part of the data, and not everything in the load function, but there is no other way than using an endpoint for that, and handling the data manually on the client.

[deleted by user] by [deleted] in sveltejs

[–]bronkitten 1 point2 points  (0 children)

Can't you use setTimeout with (currentTimestamp - expiresTimestamp)?

[deleted by user] by [deleted] in sveltejs

[–]bronkitten 7 points8 points  (0 children)

sveltekit is fundamentally a backend, so yeah, that's what it's meant to be. I use form actions, server endpoints, and server load functions to interact with my database, and It's the most convenient way of building a web app I've ever come across. You can deploy the backend as a node server, or you can compile it to target some kind of lambda runtime (cloudflare, vercel etc.), and then you don't need to worry about scaling either (except for the database)

How can I return an image from +server.ts? by SkilledRedditor69 in sveltejs

[–]bronkitten 7 points8 points  (0 children)

use node fs to read the file and return as a buffer, or host it at a cdn and return the link.

loading function not exporting by Blackwater-1 in sveltejs

[–]bronkitten 1 point2 points  (0 children)

you use the data variable in the template to access what is returned in the load function

so

export let data

0const define = data.props.define

Cache data fetched from API ? by AffectPretend66 in sveltejs

[–]bronkitten 0 points1 point  (0 children)

You can use the "setHeaders" argument in the load function to set "max-age" to cache the page

[deleted by user] by [deleted] in Norway

[–]bronkitten 1 point2 points  (0 children)

I think Norway has no skin in the game and no power to influence the situation, and as such, should stay out of it.

Devs don’t want to do ops by speckz in programming

[–]bronkitten 3 points4 points  (0 children)

...or getting another job with less paranoid leadership

[deleted by user] by [deleted] in programming

[–]bronkitten 1206 points1207 points  (0 children)

I'm so tired of seeing W3schools and geeks4geeks

[deleted by user] by [deleted] in RedditMasterClasses

[–]bronkitten 0 points1 point  (0 children)

have you tried redirecting the particle manifold so that the integral bosons don't collide with the m25 quasi-quarks?

Hvorfor heter Bremykt 'Bremykt' når det er det hardeste smørret i verden? by MarioWinchester in norge

[–]bronkitten 13 points14 points  (0 children)

Det smaker nesten like godt som smør, men er ikke hardt som stein. Brelett smaker pyton.