Skip to content

refactor: convert exported arrow consts to function declarations#1048

Draft
HerringtonDarkholme wants to merge 3 commits into
relayprotocol:mainfrom
HerringtonDarkholme:refactor/export-function-declarations
Draft

refactor: convert exported arrow consts to function declarations#1048
HerringtonDarkholme wants to merge 3 commits into
relayprotocol:mainfrom
HerringtonDarkholme:refactor/export-function-declarations

Conversation

@HerringtonDarkholme

@HerringtonDarkholme HerringtonDarkholme commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Converts every export const foo = (...) => {...} arrow function to an export function foo(...) {...} declaration across all packages (sdk, ui, hooks, and the wallet adapters).

119 conversions across 87 files.

What changed

  • export const foo = (...) => {...}export function foo(...) {...}
  • Async, generic (<T,><T>), and explicit-return-type variants handled
  • Expression-body arrows wrapped in return
  • Typed React components (export const Foo: FC<Props> = ({...}) => {...}) → export function Foo({...}: Props) {...}, with the now-unused FC/FunctionComponent import removed (kept where non-exported helpers in the same file still reference it)

Left untouched

Non-exported arrow consts, forwardRef/memo components, object/value consts, and default exports.

Behavior preservation

Arrow functions and function declarations differ in this/arguments binding, constructor usage, and prototype/new.target. Verified none of these apply:

  • this — not referenced in any of the 87 changed files (word-boundary search)
  • arguments — not referenced in any of the 87 changed files
  • None of the converted functions are used as constructors (new), and .prototype/new.target are not referenced

Hoisting differs (TDZ vs hoisted) but is harmless for module-level exports. The conversion is therefore behavior-preserving.

Verification

  • 0 exported arrow consts remain
  • SDK typecheck passes
  • UI typecheck surfaces only 3 pre-existing errors (in untouched function bodies of ErrorStep.tsx / DepositAddressModalRenderer.tsx), not introduced by this refactor
  • Prettier applied to all changed files

🤖 Generated with Claude Code

HerringtonDarkholme and others added 2 commits June 27, 2026 14:51
Replace `export const foo = (...) => {...}` with `export function foo(...) {...}`
across all packages (sdk, ui, hooks, wallet adapters). Typed React components
(`FC<Props>`) move the prop type onto the parameter and drop the now-unused
FC import.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@HerringtonDarkholme is attempting to deploy a commit to the Uneven Labs Team on Vercel.

A member of the Team first needs to authorize it.

@HerringtonDarkholme HerringtonDarkholme marked this pull request as draft June 29, 2026 16:22
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant