SSR with Deno (via deno_rider)#212
Open
bu6n wants to merge 5 commits into
Open
Conversation
deno_rider is declared as an optional dependency (~> 0.2.0). Changes: - lib/ssr/deno.ex: new adapter implementing @behaviour LiveSvelte.SSR - test/ssr_deno_test.exs: behaviour, NotConfigured error, and server_path/0 coverage - mix.exs: {:deno_rider, \"~> 0.2.0\", optional: true} - guides/ssr.md: Deno mode section with glibc >= 2.38 compatibility note - guides/configuration.md: ssr_module table updated to list Deno as third option - CHANGELOG.md: Unreleased entry
Adds bench/ssr_benchmark.exs which: - Writes a self-contained fixture server.js (no Svelte build required) - Starts NodeJS and DenoRider supervisors programmatically - Runs Benchee across four scenarios: simple props, nested object, large list, slots - Captures telemetry :stop durations in parallel for p50/p95/p99 reporting Adds benchee ~> 1.3 as a dev dependency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We have been using a similar setup in production since almost a year without a hitch. I figured out it would be nice to upstream it.
Example project can be migrated with (ran inside
./example_project):mix live_svelte.migrate --ssr-node-to-denoand back:
mix live_svelte.migrate --ssr-deno-to-nodeExample project can be started with Deno with:
You can then test SSR in
http://localhost:4000/live-ssr.There's 1 small caveat:
There's a benchmark that can be ran with
mix run bench/ssr_benchmark.exs. It's the first time I write such a benchmark, so take it with a grain of salt. Here's the output on my computer:Agents were involved, but overall I think it shows good things for Deno.
If this is upstreamed, we may want to make the nodejs dep optional, but this is a breaking change.