Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the direct @dfinity/utils dependency from both the main frontend and the try-ii sub-frontend. The library was only used for isNullish/nonNullish null-check helpers and jsonReplacer/jsonReviver JSON serialization utilities. All usages are replaced with equivalent plain JavaScript comparisons (=== undefined, === null, !== undefined) and an inline re-implementation of jsonReplacer/jsonReviver in writable.store.ts.
Changes:
- Removes
@dfinity/utilsfrompackage.jsonandsrc/try-ii/.../package.json; replaces allisNullish/nonNullishcalls with explicit=== undefined/=== null/!== undefinedcomparisons across ~50 files. - Inlines
jsonReplacerandjsonReviver(handling BigInt, Principal, Uint8Array) intowritable.store.tsand updates the test import accordingly. - Migrates a few call sites to
NonNullable<typeof credential>typed type guards wherefilter(nonNullish)was previously used as a predicate.
Reviewed changes
Copilot reviewed 73 out of 74 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
package.json / package-lock.json |
Removes @dfinity/utils as a direct dependency |
src/try-ii/.../package.json |
Removes @dfinity/utils from try-ii sub-project |
src/frontend/src/lib/stores/writable.store.ts |
Inlines jsonReplacer / jsonReviver implementations |
src/frontend/src/lib/stores/writable.store.test.ts |
Updates jsonReplacer import to local path |
src/frontend/src/lib/flows/authFlow.svelte.ts |
Replaces nullish checks; accidentally drops configURL from requestConfig |
All other .ts / .svelte files |
Replaces isNullish/nonNullish with plain JS comparisons |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aterga
approved these changes
Mar 10, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Remove dfinity utils dependency, given that it's only used for nullish checks and a json replacer/reviver in one place.
Changes
@dfinity/utilsdependency.isNullishandnonNullishto plain JS (based on TS value type being eitherundefined,nullorundefined | null).Tests
All existing tests should pass as-is.