Skip to content

chore(ensnode-react): Housekeeping refactors#1863

Merged
Y3drk merged 12 commits intomainfrom
y3drk/chore/ensnode-react-housekeeping
Apr 7, 2026
Merged

chore(ensnode-react): Housekeeping refactors#1863
Y3drk merged 12 commits intomainfrom
y3drk/chore/ensnode-react-housekeeping

Conversation

@Y3drk
Copy link
Copy Markdown
Contributor

@Y3drk Y3drk commented Apr 2, 2026

Lite PR → ensnode-react housekeeping refactors

Summary


Why


Testing

  • Ran the lint & typecheck commands locally to make sure that the new changes didn't break anything
  • Confirmed the above with our CI workflow
  • Needs further testing to confirm that all changes work as expected (planning to do so in ensadmin, where all affected elements are used) → UPDATE: The useResolvedIdentity hook changes were tested in EnsAwards using the preview release of the ens-node-react-package

Notes for Reviewer (Optional)

  • Appreciate @tk-o 's advice on how these changes should be tested (other than code-review & e2e tests in ensadmin) → UPDATE: Resolved (see above)

Pre-Review Checklist (Blocking)

  • This PR does not introduce significant changes and is low-risk to review quickly.
  • Relevant changesets are included (or are not required)

@Y3drk Y3drk self-assigned this Apr 2, 2026
Copilot AI review requested due to automatic review settings April 2, 2026 11:50
@Y3drk Y3drk added the javascript Pull requests that update javascript code label Apr 2, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 2, 2026

🦋 Changeset detected

Latest commit: 7651ed3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 23 packages
Name Type
@ensnode/ensnode-sdk Major
@ensnode/ensnode-react Major
ensadmin Major
ensapi Major
ensindexer Major
ensrainbow Major
fallback-ensapi Major
@namehash/ens-referrals Major
@ensnode/ensdb-sdk Major
@ensnode/ensrainbow-sdk Major
@ensnode/integration-test-env Patch
@namehash/namehash-ui Major
@docs/ensnode Major
@docs/ensrainbow Major
enssdk Major
enscli Major
enskit Major
ensskills Major
@ensnode/datasources Major
@ensnode/ponder-sdk Major
@ensnode/ponder-subgraph Major
@ensnode/shared-configs Major
@docs/mintlify Major

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

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
admin.ensnode.io Ready Ready Preview, Comment Apr 7, 2026 11:51am
ensnode.io Ready Ready Preview, Comment Apr 7, 2026 11:51am
ensrainbow.io Ready Ready Preview, Comment Apr 7, 2026 11:51am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

Important

Review skipped

This 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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6afc16e1-e7f5-4c02-aed5-bdc8aae41e9c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Replaces the deprecated ENSNodeClient with EnsApiClient across SDK and React packages, removes the ENSNodeClient alias/export, adds three changeset files for minor version bumps, and updates useResolvedIdentity to merge immutable-query options (including refetchInterval: false) and set enabled: true on its composed query config.

Changes

Cohort / File(s) Summary
Changesets
.changeset/cool-hotels-dress.md, .changeset/stale-wombats-help.md, .changeset/two-rice-flash.md
Add three changeset entries documenting minor version bumps for SDK and React packages and the hook query-option change.
React — hooks / provider / queries
packages/ensnode-react/src/hooks/useResolvedIdentity.ts, packages/ensnode-react/src/provider.tsx, packages/ensnode-react/src/utils/query.ts
Switched imports/constructors from ENSNodeClientEnsApiClient. useResolvedIdentity now merges ASSUME_IMMUTABLE_QUERY plus refetchInterval: false into the forwarded query config and forces enabled: true.
SDK — client / exports / docs
packages/ensnode-sdk/src/ensapi/client.ts, packages/ensnode-sdk/src/ensapi/index.ts, packages/ensnode-sdk/README.md
Removed deprecated ENSNodeClient class and its re-export; README examples updated to import/instantiate EnsApiClient instead of ENSNodeClient.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

ensnode-internal

Poem

🐰 I hop along the code-lined trail,
Old alias gone, new client hale,
Changesets tucked in tidy rows,
Queries kept calm where cache wind blows,
I nibble bytes and twitch my tail.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'chore(ensnode-react): Housekeeping refactors' is vague and generic, using non-descriptive terms like 'housekeeping refactors' without conveying the specific changes made (removing deprecated client, optimizing refetch behavior). Provide a more specific title that highlights the main changes, such as 'chore(ensnode-react): Replace deprecated ENSNodeClient and optimize refetch behavior' or similar.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The PR description is well-structured and follows the template with all required sections (Summary, Why, Testing, Notes, Checklist) completed with sufficient detail, commit links, and issue references.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ENSNodeClient usages with EnsApiClient in ensnode-react and updated the ensnode-sdk README accordingly.
  • Added default staleTime and refetchInterval (5 minutes) for useResolvedIdentity.
  • Added Changesets entries for @ensnode/ensnode-react and @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.

Copy link
Copy Markdown
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Y3drk Thanks for your updates here. Reviewed and shared feedback please take the lead to merge 👍

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 7, 2026

Greptile Summary

This PR completes the migration from the deprecated ENSNodeClient to EnsApiClient across ensnode-react, and applies ASSUME_IMMUTABLE_QUERY settings to useResolvedIdentity to reduce redundant network fetches for identity data.

  • Removed the deprecated ENSNodeClient stub class from ensnode-sdk and its public barrel export
  • Replaced all ENSNodeClient usages with EnsApiClient in ensnode-react's seven query factory functions and the createConfig provider helper
  • Applied ASSUME_IMMUTABLE_QUERY (staleTime: Infinity, gcTime: Infinity, refetchOnMount: false, refetchOnWindowFocus: false, refetchOnReconnect: false) to useResolvedIdentity — user-provided query options are spread after, so callers can still override any field
  • Updated the ensnode-sdk README to consistently document EnsApiClient
  • The ASSUME_IMMUTABLE_QUERY and ensnode-react changesets are correctly versioned as minor; however, the ensnode-sdk changeset for removing ENSNodeClient should be major since it removes a previously public export and will break any external consumers still importing the deprecated class

Confidence Score: 4/5

Safe 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

Filename Overview
.changeset/cool-hotels-dress.md Removes ENSNodeClient from SDK; versioned as minor but should be major (breaking removal of public export)
.changeset/stale-wombats-help.md Adds minor changeset for applying ASSUME_IMMUTABLE_QUERY to useResolvedIdentity — correctly versioned
.changeset/two-rice-flash.md Adds minor changeset for replacing ENSNodeClient with EnsApiClient in ensnode-react — correctly versioned
packages/ensnode-react/src/hooks/useResolvedIdentity.ts ASSUME_IMMUTABLE_QUERY spread before user _query options, allowing caller overrides — correct ordering
packages/ensnode-react/src/provider.tsx ENSNodeClient cleanly replaced with EnsApiClient in createConfig helper — both defaultOptions() calls updated
packages/ensnode-react/src/utils/query.ts All seven query factory functions updated from ENSNodeClient to EnsApiClient with no leftover references
packages/ensnode-sdk/README.md Documentation fully updated to use EnsApiClient throughout all examples and descriptions
packages/ensnode-sdk/src/ensapi/client.ts Deprecated ENSNodeClient stub class removed; EnsApiClient and its options types remain intact
packages/ensnode-sdk/src/ensapi/index.ts ENSNodeClient removed from public barrel export; ClientOptions deprecated type alias retained appropriately

Sequence Diagram

sequenceDiagram
    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)
Loading

Reviews (1): Last reviewed commit: "Apply 04/06/26 GitHub review feedback" | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

🚀 Preview Packages - y3drk/chore/ensnode-react-housekeeping

NPM Packages:

# Install latest preview for this branch
pnpm add @ensnode/datasources@preview-y3drk-chore-ensnode-react-hous
pnpm add @ensnode/ensnode-react@preview-y3drk-chore-ensnode-react-hous
pnpm add @ensnode/ensrainbow-sdk@preview-y3drk-chore-ensnode-react-hous
pnpm add @ensnode/ensdb-sdk@preview-y3drk-chore-ensnode-react-hous
pnpm add @ensnode/ensnode-sdk@preview-y3drk-chore-ensnode-react-hous
pnpm add @ensnode/ponder-sdk@preview-y3drk-chore-ensnode-react-hous
pnpm add @ensnode/ponder-subgraph@preview-y3drk-chore-ensnode-react-hous
pnpm add @ensnode/ens-referrals@preview-y3drk-chore-ensnode-react-hous
pnpm add @ensnode/namehash-ui@preview-y3drk-chore-ensnode-react-hous

# Or install specific version
pnpm add @ensnode/ensnode-sdk@0.0.0-preview-y3drk-chore-ensnode-react-hous-20260407111820

Build Info:

  • 🎯 Target: 📦 NPM packages only
  • 📦 Version: 0.0.0-preview-y3drk-chore-ensnode-react-hous-20260407111820
  • 📝 Commit: f4dff7f8
  • 🌿 Branch: y3drk/chore/ensnode-react-housekeeping
  • ⏰ Built: 2026-04-07 11:19:08 UTC
  • 🔗 Workflow Run

🤖 This comment will be updated on subsequent publishing of release previews from the branch associated with this PR

Note: Preview packages are managed by changesets. NPM dist-tags can be cleaned up manually using npm dist-tag rm @ensnode/ensnode-sdk preview-y3drk-chore-ensnode-react-hous

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5e74d38 and f4dff7f.

📒 Files selected for processing (1)
  • packages/ensnode-react/src/hooks/useResolvedIdentity.ts

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Y3drk Y3drk merged commit 29afaa6 into main Apr 7, 2026
16 checks passed
@Y3drk Y3drk deleted the y3drk/chore/ensnode-react-housekeeping branch April 7, 2026 11:59
@github-actions github-actions bot mentioned this pull request Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace references to ENSNodeClient Update ENSAwards to remove default staleTime after useResolvedIdentity is published

3 participants