Skip to content

Conversation

@gregfromstl
Copy link
Contributor

@gregfromstl gregfromstl commented Aug 11, 2025


PR-Codex overview

This PR focuses on deprecating the sortBy parameter in the Bridge.routes of the thirdweb package, indicating that it should no longer be used in future implementations.

Detailed summary

  • Deprecates the sortBy parameter in Bridge.routes.
  • Updates the documentation for sortBy to include a @deprecated tag, clarifying its status.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • None
  • Documentation

    • Marked the sortBy option in the Bridge routes API as deprecated in public documentation. Behavior remains unchanged; the parameter is still accepted and forwarded if provided. Existing integrations are unaffected, but developers should plan to remove usage.
  • Chores

    • Prepared a patch release for the thirdweb package with an added changeset entry.

@gregfromstl gregfromstl requested review from a team as code owners August 11, 2025 00:40
@changeset-bot
Copy link

changeset-bot bot commented Aug 11, 2025

🦋 Changeset detected

Latest commit: d216d76

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

This PR includes changesets to release 3 packages
Name Type
thirdweb Patch
@thirdweb-dev/nebula Patch
@thirdweb-dev/wagmi-adapter Patch

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

vercel bot commented Aug 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 11, 2025 0:52am
nebula ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 11, 2025 0:52am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 11, 2025 0:52am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 11, 2025 0:52am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 11, 2025 0:52am

@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 11, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Aug 11, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 11, 2025

Walkthrough

Deprecation annotation added to the sortBy option in the bridge Routes options. A changeset is introduced to publish a patch release for the thirdweb package reflecting this deprecation. No runtime or control flow changes.

Changes

Cohort / File(s) Summary of Changes
Changeset update
./.changeset/shaky-candles-rule.md
Adds a patch changeset for thirdweb; documents deprecation of Bridge.routes sortBy parameter.
Bridge routes deprecation annotation
packages/thirdweb/src/bridge/Routes.ts
Adds JSDoc deprecation to Options.sortBy ("popularity"); no signature or behavior changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch greg/deprecate-routes-sort-by

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
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

🧹 Nitpick comments (1)
.changeset/shaky-candles-rule.md (1)

1-5: Strengthen the changeset with migration guidance and deprecation details

Add a short rationale, what to use instead (likely “remove the option; default sort is used”), and an estimated removal timeline. This helps downstream consumers and release notes readers.

Proposed tweak:

 ---
 "thirdweb": patch
 ---
 
-Deprecates `sortBy` parameter in Bridge.routes
+Deprecate `Bridge.routes` option `sortBy`.
+
+Why:
+- The API now determines sorting internally; external sorting is no longer supported.
+
+Impact:
+- No runtime behavior change in this release. Passing `sortBy` continues to work but is deprecated.
+
+Migration:
+- Remove the `sortBy` option from calls to `Bridge.routes`. The default ordering will be used.
+
+Deprecation plan:
+- `sortBy` will be removed in a future release after a standard deprecation period.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fde39eb and d216d76.

📒 Files selected for processing (2)
  • .changeset/shaky-candles-rule.md (1 hunks)
  • packages/thirdweb/src/bridge/Routes.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

Files:

  • packages/thirdweb/src/bridge/Routes.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • packages/thirdweb/src/bridge/Routes.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Size
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Build Packages
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)

Comment on lines +206 to +209
/**
* Sort routes by popularity
* @deprecated
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Add a deprecation message and align surrounding docs/examples

The @deprecated tag is good, but include a clear message and update earlier examples/param docs that still promote sortBy to avoid mixed signals.

Suggested JSDoc change:

     /**
-     * Sort routes by popularity
-     * @deprecated
+     * Sort routes by popularity.
+     * @deprecated This option is deprecated and will be removed in a future release.
+     * Routes are now sorted by default by the API. Remove this option from your calls.
      */

Follow-ups:

  • Remove or annotate the example that uses sortBy: "popularity" and update the @param options.sortBy description above to reflect deprecation.
  • Optionally, consider a one-time runtime warning when sortBy is provided to aid discoverability (can be added behind a development flag).

Repo sweep to find usages:


🏁 Script executed:

#!/bin/bash
# Find references to Bridge.routes sortBy to update examples/tests/docs.
rg -n --no-heading --color=never $'Bridge\\.routes\\s*\\(|sortBy\\s*:\\s*"popularity"|options\\.sortBy' -A 2 -B 2

Length of output: 9405


Action required: Add a clear deprecation message to Options.sortBy and update docs/tests/examples

Short summary:

  • The JSDoc on Options.sortBy is marked @deprecated but has no message. Repository search shows many examples/tests/CHANGELOG entries still using sortBy (including sortBy: "popularity"). This will confuse users unless the deprecation is documented and references are updated.

Files/locations that need attention (from the repo scan):

  • packages/thirdweb/src/bridge/Routes.ts
    • Example blocks using sortBy: "popularity" and the @param options.sortBy JSDoc
  • packages/thirdweb/CHANGELOG.md
    • Historical sample code includes sortBy: "popularity" (update or annotate)
  • packages/thirdweb/src/react/core/hooks/useBridgeRoutes.test.ts
    • Test sets sortBy: "popularity" — update expected behavior or remove this option
  • apps/portal/** (multiple .mdx pages)
    • Examples in docs still pass sortBy — update examples or annotate as deprecated
  • packages/thirdweb/src/react/core/hooks/transaction/useSendTransaction.ts
    • Calls Bridge.routes — verify callers for sortBy usage

Suggested JSDoc change (apply to Options.sortBy JSDoc):

     /**
-     * Sort routes by popularity
-     * @deprecated
+     * Sort routes by popularity.
+     * @deprecated This option is deprecated and will be removed in a future release.
+     * Routes are now ordered by the API by default — remove this option from your calls.
      */

Recommended follow-up actions

  • Update the JSDoc as shown above to include a deprecation message and migration guidance.
  • Replace or annotate all examples in Routes.ts and .mdx docs that show sortBy: "popularity". Prefer removing the option from examples and adding a short note that sorting is done server-side now.
  • Update tests that assert behavior with sortBy:
    • Remove sortBy from fixtures/tests, or
    • Adjust tests to assert that providing sortBy has no effect (if that’s the intended compatibility behavior).
  • Update CHANGELOG examples or annotate them as historical if you wish to preserve the snippet.
  • Optional (recommended for discoverability): add a one-time dev-mode runtime warning when options.sortBy is provided, e.g.:
// inside the Bridge.routes implementation (dev-only)
if (options?.sortBy && process.env.NODE_ENV !== "production") {
  const key = "__THIRDWEB_SORTBY_DEPRECATION_SHOWN";
  if (!(globalThis as any)[key]) {
    console.warn(
      "[thirdweb] `options.sortBy` is deprecated and will be removed in a future release. The API sorts routes by default; remove this option from your calls."
    );
    (globalThis as any)[key] = true;
  }
}

Repo sweep (improved search to find remaining usages):

# Find literal usages of sortBy (skip node_modules/dist/build)
rg -n --no-heading --color=never --hidden --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' '\bsortBy\b' -S

Notes:

  • CHANGELOG entries are often historical; if you keep historical examples, annotate them so readers aren't misled.
  • If you want to avoid runtime changes in this PR, at minimum update docs/tests to reflect the deprecation message and plan a follow-up PR for any runtime warnings or lint rules.
🤖 Prompt for AI Agents
packages/thirdweb/src/bridge/Routes.ts around lines 206-209: the JSDoc for
Options.sortBy is marked @deprecated but lacks any deprecation message or
migration guidance; update the JSDoc to include a clear deprecation message and
suggested migration (e.g., "deprecated — server now handles route sorting;
remove this option") and reference the replacement behavior, then scan and
update examples/tests/docs that still pass sortBy (remove the option or annotate
as deprecated) and adjust tests to either stop asserting on sortBy or assert it
has no effect; optionally add a dev-only runtime warning when options.sortBy is
provided to surface the deprecation during development.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 11, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.03 KB (0%) 1.3 s (0%) 214 ms (+67.78% 🔺) 1.5 s
thirdweb (cjs) 357.38 KB (0%) 7.2 s (0%) 502 ms (+6.01% 🔺) 7.7 s
thirdweb (minimal + tree-shaking) 5.72 KB (0%) 115 ms (0%) 75 ms (+243.69% 🔺) 190 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 40 ms (+648.45% 🔺) 50 ms
thirdweb/react (minimal + tree-shaking) 19.16 KB (0%) 384 ms (0%) 67 ms (+100.78% 🔺) 451 ms

@gregfromstl gregfromstl merged commit a77e98a into main Aug 11, 2025
28 of 30 checks passed
@gregfromstl gregfromstl deleted the greg/deprecate-routes-sort-by branch August 11, 2025 01:03
@joaquim-verges joaquim-verges mentioned this pull request Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants