Skip to content
This repository was archived by the owner on Aug 5, 2026. It is now read-only.

'Generate ENS referral link' form refinement - #60

Merged
Y3drk merged 16 commits into
mainfrom
y3drk/feat/generate-referral-link-form-refinement
Nov 24, 2025
Merged

Y3drk merged 16 commits into
mainfrom
y3drk/feat/generate-referral-link-form-refinement

Conversation

@Y3drk

@Y3drk Y3drk commented Nov 19, 2025

Copy link
Copy Markdown
Contributor

Implements a new, extended version of the Generate your ENS Referral Program link form.

More details available in this Slack thread.

Some dependency vulnerabilities are taken care of in PR #58, and some version bumps are a part of this PR as well.

@Y3drk Y3drk self-assigned this Nov 19, 2025
@Y3drk
Y3drk requested a review from a team as a code owner November 19, 2025 17:30
@vercel

vercel Bot commented Nov 19, 2025

Copy link
Copy Markdown
Contributor

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

Project Deployment Preview Comments Updated (UTC)
ensawards.org Ready Ready Preview Comment Nov 24, 2025 8:39am

@lightwalker-eth lightwalker-eth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Y3drk Hey great to see these updates. The logic all looks to produce the correct outputs 👍 So please feel welcome to take the lead to merge this PR when ready. The feedback I shared here is all focused on optimizing the way the code is written 👍

Comment thread ensawards.org/.env.local.example Outdated
Comment thread ensawards.org/src/utils/env/onClientAccess.ts Outdated
Comment thread ensawards.org/src/utils/env/testAccess.ts Outdated
Comment thread ensawards.org/src/components/molecules/ReferralLinkForm.tsx Outdated
Comment thread ensawards.org/src/components/molecules/ReferralLinkForm.tsx Outdated
Comment thread ensawards.org/src/components/molecules/ReferralLinkForm.tsx Outdated
import { cn } from "@/utils/tailwindClassConcatenation.ts";
import { Link2 as LinkIcon, RefreshCw as RefreshIcon } from "lucide-react";
import React, { type FormEvent, useEffect, useState } from "react";
import { ENSNodeClient, type Name, type ResolveRecordsResponse } from "@ensnode/ensnode-sdk";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I note here how you are integrating with the ensnode-sdk package.

Is there a special reason why you chose to integrate at that level rather than using the ensnode-react package?

https://github.com/namehash/ensnode/blob/57bd01dfb41b8b95f0aea8b8942eb1f68311632c/packages/ensnode-react/README.md

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@lightwalker-eth

There are a few reasons why I wanted to go a level lower here:

  1. Due to how astro islands work, each one of these would need to have a separate <ENSNodeProvider />. While it's not an issue currently, I'd prefer to limit their number as much as possible, especially since we will have to use it 100% for latest indexed registrations. It might or might not turn out not to be a performance issue, but it definitely makes the code more obscure and potentially harder to debug.
  2. In this form, the resolution only runs once per scenario, when the user clicks "Generate", hence there is no need for caching or refetching the tanstack query inside the ensnode-react provides. Ofc it's still possible to set up the useRecords hook for that, but it feels a bit like using a sledgehammer to crack a nut...
  3. ... and due to multiple validation steps performed in the submit function, the isLoading feature doesn't bring any immediate benefits either, as the "loading" state is set way before the actual resolution starts, and the end of it doesn't mean the loading ends either.

All in all, I just feel like for this particular form submit, using the React wrapper is an overkill.
Both approaches are possible, but for this case, I'd prefer to keep using the ensnode-sdk directly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Y3drk Ok cool. Really appreciate your message here on why. Thanks

Comment thread ensawards.org/src/components/molecules/ReferralLinkForm.tsx Outdated

const lookupENSName = async (name: Name) => {
const lookupPromise = client.resolveRecords(name, {
addresses: [60], // ETH CoinType

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment thread ensawards.org/src/components/molecules/ReferralLinkForm.tsx Outdated

@lightwalker-eth lightwalker-eth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Y3drk Hey thanks for your updates. Reviewed and shared feedback 👍

Comment thread ensawards.org/.env.local.example Outdated
Comment thread ensawards.org/.env.local.example Outdated
Comment thread ensawards.org/.env.local.example Outdated
Comment thread ensawards.org/.env.local.example Outdated
Comment thread ensawards.org/src/components/molecules/ReferralLinkForm.tsx Outdated
Comment thread ensawards.org/src/components/molecules/ReferralLinkForm.tsx Outdated
Comment thread ensawards.org/src/components/molecules/ReferralLinkForm.tsx Outdated
Comment thread ensawards.org/src/components/molecules/ReferralLinkForm.tsx Outdated
Comment thread ensawards.org/src/components/molecules/ReferralLinkForm.tsx Outdated

@lightwalker-eth lightwalker-eth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Y3drk Hey looks good, thanks 👍 I pushed a few small refinements. There's still 1 key remaining open question for you. Please take the lead to merge this PR as soon as you're ready. Thanks 👍

Comment thread ensawards.org/src/components/molecules/ReferralLinkForm.tsx Outdated
Comment thread ensawards.org/.env.local.example Outdated
Comment thread ensawards.org/.env.local.example Outdated
@Y3drk
Y3drk merged commit a9c449a into main Nov 24, 2025
9 checks passed
@Y3drk
Y3drk deleted the y3drk/feat/generate-referral-link-form-refinement branch November 24, 2025 08:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants