nuqayah.bsky.social
@nuqayah.bsky.social
13 followers 2 following 55 posts
Posts Media Videos Starter Packs
Thanks for the tip. Much better dx. And shaved 85kb off my svelte bundle size (moved from paraglide).
vite-plugin-domain: no-config ssl domains, powered by
@caddy.bsky.social (@vite.dev)

Easy as adding `domain()` to `plugins: [...]`. I work on tons of Svelte apps simultaneously, so this is a life saver.

npmjs.com/package/vite-plugin-domain
Oh, there's a plugin for that, nice! I'll move to it for my projects. It's tedious duplicating aliases. :)

www.npmjs.com/package/vite...
Thanks for explaining Ben! I add aliases to tsconfig.json for that reason.

Can't svelte-pkg read from it too? I think it's what most tools refer to.

Even vite should read from it imo, but maybe there is a reason it doesn't.
In spirit of "use the platform", is there a reason why svelte-package can't read aliases from vite directly (resolve.alias)? Instead of forcing the user to create kit.alias.

For the same reason can't `svelte.config.js` entirely be avoided? I had to add it just to appease svelte-package.
Thanks rich! Can we call it prerendering then? Since it's not network related (load), but execution related (render).
> for frameworks like SvelteKit to implement preloading

nit: this phrasing can mislead, as sveltekit has (data) preloading, right?

> You can speed up client-side navigations by eagerly preloading the necessary code and data, using link options.
svelte.dev/docs/kit/per...
i rewrote a popular next.js site in svelte. LOC before/after: 1/5th* of the code. <3 svelte

(this is a follow upon my previous post bsky.app/profile/nuqa...)

* 1/5th and not 1/6.7th since there are a few more features to add to svelte version
i rewrote a popular next.js site in svelte. before/after. <3 svelte
minor: `onerror = () => {}` is valid js, but fails in a .svelte.js file.

svelte.dev/playground/h...
That is true, I was being facetious 😄
svelte.dev

$> new Set(Object.keys(window)).difference(new Set('window,self,...').split(',')))

Set(5) {'__sveltekit_1hmftqw', '__svelte', 'si', 'vam', 'va'}

:)
And it's nice to have window.router.goto/route/etc just like there are `location.*` and `history.*` globals.
Thanks for replying Paolo! I've build an SPA router. I attach it to `window` in all cases. So it'd be useful if `window.router.route` was a reactive property.

I can use context or import in another way. But prefer a global var, for `window.router` consistency.

And context doesn't work for js files
Svelte: is there a way to attach a reactive object (rune or store) to window? To make the below examples possible

- `URL: {window.$route.url}` (if a store)
- const url = $derived(window.route.url)
- $effect(() => { console.log(window.route.url) })

(I know the idiomatic solution is `context`)
thanks for the mcp — very useful. can we get a skill/cli as well?

simonwillison.net/2025/Oct/16/...
Thanks, that makes sense!
svelte kit docs:
> Data will never be preloaded if the user has chosen reduced data usage, meaning navigator.connection.saveData is true.

This makes sense, but not for mousedown/touchstart, as that will virtually always result in a click (right?).

So this simply slows down svkit sites.
i was reading svelte kit's source. this seems to contradict? or am i missing something.
> SvelteKit felt a bit heavy with its file conventions. React + React Router felt more stripped back

Strong agree, and I've been telling the svelte team this.
nice!
using svg:
svelte.dev/playground/2...

a bit shorter, but requires js to trigger the animation. not sure if that can be simplified.
Why is this now a warning? My svelte config is in vite.config.js.

[vite-plugin-svelte] no Svelte config found at /path/to/app - using default configuration.