Skip to content

Remove @deroll/router package and update documentation - #208

Merged
tuler merged 1 commit into
prerelease/v2from
claude/deprecate-deroll-router-si1fah
Aug 14, 2026
Merged

Remove @deroll/router package and update documentation#208
tuler merged 1 commit into
prerelease/v2from
claude/deprecate-deroll-router-si1fah

Conversation

@tuler

@tuler tuler commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Summary

This PR removes the @deroll/router package entirely and updates the framework to guide users toward implementing routing directly in their inspect handlers. The router abstraction is no longer necessary since inspect payloads are now arbitrary buffers whose encoding is application-specific.

Key Changes

  • Removed @deroll/router package: Deleted the entire package including source code, tests, configuration, and changelog
  • Updated documentation:
    • Removed router-specific documentation pages (overview.mdx, create-router.mdx, add.mdx)
    • Added comprehensive "Dispatching queries" section to inspect-handlers.mdx with three encoding patterns: string paths, JSON, and ABI
    • Updated migration guide to explain the removal and provide migration examples
    • Updated application overview and quick-start references
  • Updated examples:
    • Removed router.ts and walletRouter.ts examples
    • Added new inspect.ts example demonstrating direct routing in the handler
  • Updated @deroll/create-app: Removed router option from CLI and template generation
  • Updated documentation site config: Removed router navigation section from vocs config

Implementation Details

The router previously abstracted URL-pattern matching for inspect requests using path-to-regexp. Since inspect payloads are now arbitrary buffers with application-chosen encoding, the routing key depends on that encoding:

  • String payloads: dispatch on path segments
  • JSON payloads: dispatch on object fields
  • ABI-encoded payloads: dispatch on function selectors

Users are guided to implement routing directly in their handlers using simple switch statements or by depending on path-to-regexp directly if pattern matching is needed. The new documentation provides clear examples for all three common encoding patterns.

https://claude.ai/code/session_01G5beDWDrK7C9gnTJGTpw7Z

The router matched inspect payloads against URL patterns, which made
sense when an inspect request *was* an HTTP GET and the payload was the
path it was made to. It is now an arbitrary buffer whose encoding the
application chooses, and the routing key follows from that choice: a
segment of a string, a field of a JSON object, a function selector under
ABI. Only the first looks like a URL.

The package also carried no knowledge of the Cartesi protocol to justify
keeping it — strip bytesToString and emitReport and what remained was
path-to-regexp behind a for-loop. Its URL metaphor was leaky besides:
match() runs against the whole payload, so query strings never matched.

There is no v2 of the package; the published versions are deprecated on
npm and stay installable, so v1 applications keep resolving.

- docs: new "Dispatching queries" section in Inspect Handlers, covering
  the string, JSON and ABI cases, plus a migration note explaining the
  removal and the path-to-regexp equivalent.
- create-app: the router library choice and --use-router are gone, and
  Library is now just "wallet".
- examples: router and walletRouter are replaced by a single inspect
  example that dispatches by hand.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G5beDWDrK7C9gnTJGTpw7Z
@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
deroll Ready Ready Preview Aug 14, 2026 2:15am
deroll-explorer Ready Ready Preview Aug 14, 2026 2:15am

@changeset-bot

changeset-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8dae6b9

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

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

@tuler
tuler merged commit 91be234 into prerelease/v2 Aug 14, 2026
4 checks passed
@tuler
tuler deleted the claude/deprecate-deroll-router-si1fah branch August 14, 2026 02:19
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.

2 participants