Repository navigation
feat: unevalStream - #218
Open
elliott-with-the-longest-name-on-github wants to merge 6 commits into
Open
elliott-with-the-longest-name-on-github wants to merge 6 commits into
elliott-with-the-longest-name-on-github wants to merge 6 commits into
Conversation
🦋 Changeset detectedLatest commit: 929fabc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
elliott-with-the-longest-name-on-github
added this pull request to stack #220
October 6, 2026 19:13
unevalStream
elliott-with-the-longest-name-on-github
force-pushed
the
elliott/warp-simple
branch
from
October 8, 2026 21:44
d480bd6 to
79febc1
Compare
elliott-with-the-longest-name-on-github
removed this pull request from stack #220
October 8, 2026 21:46
elliott-with-the-longest-name-on-github
changed the base branch from
main
to
elliott/uneval-emit
October 8, 2026 21:46
elliott-with-the-longest-name-on-github
added this pull request to stack #224
October 8, 2026 21:46
elliott-with-the-longest-name-on-github
force-pushed
the
elliott/warp-simple
branch
2 times, most recently
from
October 9, 2026 03:45
eb7964c to
2fd1449
Compare
elliott-with-the-longest-name-on-github
marked this pull request as ready for review
October 9, 2026 17:55
elliott-with-the-longest-name-on-github
force-pushed
the
elliott/warp-simple
branch
from
October 13, 2026 22:18
7e38de6 to
929fabc
Compare
|
Install the latest version of pnpm add https://pkg.svelte.dev/devalue/c/929fabc5cd17e060bb625976e0a62a6578a76cc5Open in |
1 similar comment
|
Install the latest version of pnpm add https://pkg.svelte.dev/devalue/c/929fabc5cd17e060bb625976e0a62a6578a76cc5Open in |
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.
Adds
unevalStream, a streaming version ofunevalfor values that contain promises. This is a much smaller alternative to #183, which had grown to ~3,450 lines plus ~9,500 lines of tests.headis an expression that recreates the value with every promise pending, no matter what has already settled, so the output is deterministic and doesn't depend on timing. Callers that want already-settled promises inlined can fold them in themselves with the replacer (js`Promise.resolve(${value})`).tailis an async iterable of statement blocks that settle those promises as they settle on the server. A settled value can contain more promises, which later blocks settle.headand every block, and the replacer is called at most once per object for the whole stream.id(stable session key, for when heads need to be byte-identical),scope(where the client session table lives,globalThis.__dby default),signalandtransformError. Rejections and values that fail to serialize reach the client as a genericErrorby default;transformError(modelled on Svelte's) turns the error into whatever the client should see instead, and can return a promise. Like a replacer, returningundefined,nullorfalsekeeps the default, as does throwing or returning something unserializable.It's built on the internal
analyze/renderemitter from #223, which this PR is stacked on. The stream records where each object lives on the client during the emitter's own walk, then refers to it by path in later blocks. Paths are capped at 128 characters (at most 384 UTF-8 bytes); an object that would go deeper gets its own slot and paths restart from there, so references can't grow with the input's depth. There's no prefix aliasing on top of that: measured on SvelteKit-style streams, compression shrinks the repeated prefixes to almost nothing, and aliases came out even or slightly worse once compressed.Tests are a table-driven round-trip harness. It checks every case across settlement orders, evaluating blocks separately vs. concatenated, identity, once-per-object replacer calls and session cleanup. On top of that are random-graph, UTF-8 transport and security regressions ported from #183.
Stack created with GitHub Stacks CLI • Give Feedback 💬