Repository navigation
refactor: convert the serialization pipeline to async - #1
Merged
yousif-khalil-abdulkarim merged 10 commits intoOct 7, 2026
Merged
Conversation
- move compilerOptions out of tsconfig.json into tsconfig.base.json and have tsconfig.json extend it - add tsconfig.check.json plus an "npm run check" script that typechecks the whole of src, including test files Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Await the callbacks so callers can pass async predicates/visitors, and drop the `find` shortcut through Array#find, which returned the first entry unconditionally once the predicate became async. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Await the mapper so callers can transform values asynchronously, and update its tests to await the (now async) call. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CustomTransfomer.isApplicable/serialize/deserialize may now return promises, and findApplicable resolves the first applicable transformer asynchronously. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make the composite rules (class, symbol, custom, typed-array) async in every phase and await both the transformed value and the annotation in transformValue, so serialized output no longer contains unresolved promises. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
walker, traverse, applyValueAnnotations and applyReferentialEqualityAnnotations now await their recursive and mapper work, so async transformers and untransformers are properly resolved before their results are assigned. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
serialize, deserialize, stringify and parse now return promises, and the test suite is updated to await them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rename the package to @eridu-tech/superjson and keep the lockfile's root name in sync. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Benchmark.js only awaits an asynchronous test when it is registered with
{ defer: true } and the callback resolves the deferred. Without it the harness
measured just the synchronous prefix of the test, firing thousands of
unresolved serialize/deserialize pipelines per second until the heap was
exhausted (FATAL ERROR: Ineffective mark-compacts near heap limit).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
github-action-benchmark unconditionally fetches the gh-pages branch to read previous results, but this repository has no gh-pages branch, so the step failed every job with "fatal: couldn't find remote ref gh-pages". With no stored baseline there was nothing to compare against anyway. Also drops the now-unused `tee output.txt` (it only existed to feed the action's output-file-path, and the pipeline's exit code came from tee, which masked benchmark failures). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
yousif-khalil-abdulkarim
deleted the
enhancement/converting-to-async-funcs
branch
October 7, 2026 23:36
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.
What
Converts the serialization pipeline to async so transformers can be asynchronous.
util.find/forEach/findArrnow await their callbacks (also removes theArray#findshortcut infind, which returned the first entry whenever the predicate was async)accessDeep.setDeepawaits its mappertransformValueawaits both the transformed value and the annotationcustom-transformer-registryaccepts asyncisApplicable/serialize/deserializeplainerawaitswalker,traverseand the annotation-application passesSuperJSON.serialize/deserialize/stringify/parsereturn promisestsconfigoptions split intotsconfig.base.json+tsconfig.check.json(npm run check)Breaking change
serialize,deserialize,stringifyandparsenow return promises and must be awaited. The package is also renamed to@eridu-tech/superjson.Verification
npm run test-> 7 test files passed, 86 passed | 1 skipped | 1 todo