Then I listen to click events on the container, and if e.target.matches(data-ref) I process it accordingly.
Is there a better way?
I'm replicating what ChatGPT does.
Then I listen to click events on the container, and if e.target.matches(data-ref) I process it accordingly.
Is there a better way?
I'm replicating what ChatGPT does.
Then I listen to click events on the container, and if e.target.matches(data-ref) I process it accordingly.
Is there a better way?
I'm replicating what ChatGPT does.
github.com/serkodev/mar...
github.com/serkodev/mar...
I'm posting this so others don't fall in the same mistake. With more reliance on AI, especially to fix lint warnings, we must be careful the fix isn't worse than the warning.
I'm posting this so others don't fall in the same mistake. With more reliance on AI, especially to fix lint warnings, we must be careful the fix isn't worse than the warning.
The original streamdown has the same problem.
github.com/vercel/strea...
The original streamdown has the same problem.
github.com/vercel/strea...
The a11y_no_static_element_interactions error. My main div has an onclick. Ai saw svelte-check's warning:
> Warning: `<div>` with a click, dblclick or keydown handler must have an ARIA role
So it "helpfully" added role=button. I didn't think much of it.
The a11y_no_static_element_interactions error. My main div has an onclick. Ai saw svelte-check's warning:
> Warning: `<div>` with a click, dblclick or keydown handler must have an ARIA role
So it "helpfully" added role=button. I didn't think much of it.
A static asset took ~10ms, while an SSR'ed page took ~25ms.
A static asset took ~10ms, while an SSR'ed page took ~25ms.
Caching is without a doubt _the_ key to performance.
Caching is without a doubt _the_ key to performance.
Re ssr, fwiw (maybe not that much!), I asked ai, and it had this to say.
chatgpt.com/s/t_69175cb1...
Re ssr, fwiw (maybe not that much!), I asked ai, and it had this to say.
chatgpt.com/s/t_69175cb1...
I'm questioning whether the 200-500ms on the server will be more if moved to the client.
According to my tests, no. But it needs proper benchmarking.
I'm questioning whether the 200-500ms on the server will be more if moved to the client.
According to my tests, no. But it needs proper benchmarking.
That's the whole point. An SPA is a static asset. Sending it can be done 200-500ms faster than SSRing.
Yes, the SPA needs to request the data once it the shell has started, but I'd argue the end numbers are the same.
That's the whole point. An SPA is a static asset. Sending it can be done 200-500ms faster than SSRing.
Yes, the SPA needs to request the data once it the shell has started, but I'd argue the end numbers are the same.
> time curl -sD - -o /dev/null svelte.dev/__?_nc=$(date +%s%3N)
0m0.785s (I have to hit a 404 to avoid vercel's cache)
> time curl_h svelte.dev/_app/immutab...
0m0.279s
node added 500ms :)
> time curl -sD - -o /dev/null svelte.dev/__?_nc=$(date +%s%3N)
0m0.785s (I have to hit a 404 to avoid vercel's cache)
> time curl_h svelte.dev/_app/immutab...
0m0.279s
node added 500ms :)
That SSR process easily adds 200ms.
And like I initially said, I've been thinking about this a lot!
That SSR process easily adds 200ms.
And like I initially said, I've been thinking about this a lot!
1. In my case, I always have an external API (ie, not just kit). (I would argue this is often and maybe the majority of cases.) So there isn't much difference whether kit calls it or the client.
2. preload helps, per above
1. In my case, I always have an external API (ie, not just kit). (I would argue this is often and maybe the majority of cases.) So there isn't much difference whether kit calls it or the client.
2. preload helps, per above
You can send it in a preload header, so it's parallel.
> before JS is downloaded and parsed
The server has to do parsing as well. V8 will be cooking either way. :)
You can send it in a preload header, so it's parallel.
> before JS is downloaded and parsed
The server has to do parsing as well. V8 will be cooking either way. :)
> SSR is about performance
I thought about this a lot (I've been writing a custom router and SSR layer for Svelte).
I've concluded that js + data (SPA) can be sent independently as fast (or even faster) as they can be sent rendered together (SSR).
Thoughts?
> SSR is about performance
I thought about this a lot (I've been writing a custom router and SSR layer for Svelte).
I've concluded that js + data (SPA) can be sent independently as fast (or even faster) as they can be sent rendered together (SSR).
Thoughts?