chore(ensnode-react): Housekeeping refactors#1863
Conversation
🦋 Changeset detectedLatest commit: 7651ed3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedThis PR was authored by the user configured for CodeRabbit reviews. CodeRabbit does not review PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughReplaces the deprecated Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Pull request overview
Housekeeping updates to ensnode-react (and related docs) to complete migration away from the deprecated ENSNodeClient and to reduce unnecessary query refetching for resolved identities.
Changes:
- Replaced
ENSNodeClientusages withEnsApiClientinensnode-reactand updated theensnode-sdkREADME accordingly. - Added default
staleTimeandrefetchInterval(5 minutes) foruseResolvedIdentity. - Added Changesets entries for
@ensnode/ensnode-reactand@ensnode/ensnode-sdk.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ensnode-sdk/README.md | Updates documentation examples and headings to use EnsApiClient. |
| packages/ensnode-react/src/utils/query.ts | Migrates query option builders to instantiate EnsApiClient instead of ENSNodeClient. |
| packages/ensnode-react/src/provider.tsx | Migrates createConfig defaults to use EnsApiClient.defaultOptions(). |
| packages/ensnode-react/src/hooks/useResolvedIdentity.ts | Sets default 5-minute staleTime and refetchInterval for identity resolution queries. |
| .changeset/two-rice-flash.md | Declares a minor bump for @ensnode/ensnode-react due to client migration. |
| .changeset/stale-wombats-help.md | Declares a minor bump for @ensnode/ensnode-react due to query default changes. |
| .changeset/cool-hotels-dress.md | Declares a minor bump for @ensnode/ensnode-sdk due to README updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lightwalker-eth
left a comment
There was a problem hiding this comment.
@Y3drk Thanks for your updates here. Reviewed and shared feedback please take the lead to merge 👍
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR completes the migration from the deprecated
Confidence Score: 4/5Safe to merge after correcting the SDK changeset version bump from minor to major The code changes themselves are clean, correct, and well-structured — the EnsApiClient migration is complete across all files and the ASSUME_IMMUTABLE_QUERY addition to useResolvedIdentity is properly ordered so caller overrides still work. The only actionable concern is the changeset for ENSNodeClient removal: removing a public export is a semver-breaking change that warrants a major bump to avoid surprising external consumers who upgrade and get unexpected build errors. .changeset/cool-hotels-dress.md — the version bump should be major, not minor Important Files Changed
Sequence DiagramsequenceDiagram
participant App
participant useResolvedIdentity
participant usePrimaryName
participant Cache as React Query Cache
participant EnsApiClient
App->>useResolvedIdentity: call(identity, query opts)
useResolvedIdentity->>Cache: check cache key(address, chainId)
alt Cache hit (staleTime: Infinity)
Cache-->>useResolvedIdentity: cached primary name data
else Cache miss
useResolvedIdentity->>usePrimaryName: forward(ASSUME_IMMUTABLE_QUERY merged with _query)
usePrimaryName->>EnsApiClient: resolvePrimaryName(address, chainId)
EnsApiClient-->>usePrimaryName: ResolvePrimaryNameResponse
usePrimaryName-->>Cache: store result (gcTime: Infinity)
Cache-->>useResolvedIdentity: fresh primary name data
end
useResolvedIdentity-->>App: Identity (Named / Unnamed / Unknown / Unresolved)
Reviews (1): Last reviewed commit: "Apply 04/06/26 GitHub review feedback" | Re-trigger Greptile |
🚀 Preview Packages -
|
…ate issue discovered during testing
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/ensnode-react/src/hooks/useResolvedIdentity.ts`:
- Around line 60-65: The query currently overrides caller intent by forcing
enabled: true; restore the original enabled guard so the query respects
_query.enabled and the namespace check: set enabled to use the caller-provided
_query.enabled if present, otherwise evaluate the existing namespace/address
conditions (the same guard that usePrimaryName relies on, i.e., only allow
execution when namespace is defined and address !== null); update the query
object that spreads ASSUME_IMMUTABLE_QUERY and _query to compute enabled
accordingly rather than hardcoding true.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 0a001a62-efb5-4499-813b-e8655d0dc176
📒 Files selected for processing (1)
packages/ensnode-react/src/hooks/useResolvedIdentity.ts
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Lite PR →
ensnode-reacthousekeeping refactorsSummary
Why
ENSNodeClient#1637 (ensnode-react was the last place where the issue wasn't implemented)Testing
lint&typecheckcommands locally to make sure that the new changes didn't break anythinguseResolvedIdentityhook changes were tested in EnsAwards using the preview release of the ens-node-react-packageNotes for Reviewer (Optional)
Pre-Review Checklist (Blocking)