Skip to content

chore: bump dojo.c to get latest publishMessage endpoint #453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025

Conversation

MartianGreed
Copy link
Collaborator

@MartianGreed MartianGreed commented Jun 11, 2025

Closes #

Introduced changes

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added relevant tests
  • Add a dedicated CI job for new examples
  • Performed self-review of the code

Summary by CodeRabbit

  • Bug Fixes

    • Removed the relayUrl property from all client configuration options across SDKs, examples, and documentation.
    • Updated the expected result type of the sendMessage method to return a string instead of a byte array.
  • Documentation

    • Updated usage examples and documentation to reflect the removal of the relayUrl property and improved formatting.
  • Chores

    • Synchronized package versions to incorporate the latest updates and endpoints.

Copy link

coderabbitai bot commented Jun 11, 2025

Walkthrough

This update removes the relayUrl property from configuration objects and related code across multiple packages and examples. It also changes the return type of the sendMessage method from Promise<Result<Uint8Array, string>> to Promise<Result<string, string>> in relevant SDK interfaces and implementations. The update synchronizes with the latest dojo.c submodule.

Changes

Files/Paths Change Summary
examples/example-* (main.ts, main.tsx, setup.ts) Removed relayUrl property from client configuration in all initialization and setup code.
packages/core/src/config/index.ts Removed relayUrl from config interface, defaults, and returned config object.
packages/sdk/src/internal/types.ts Changed sendMessage return type from Promise<Result<Uint8Array, string>> to Promise<Result<string, string>>.
packages/sdk/src/node/index.ts, packages/sdk/src/web/index.ts Removed relayUrl from default config; updated sendMessage return type to Promise<Result<string, string>>.
packages/sdk/src/example/index.ts, packages/sdk/src/tests/generateTypedData.test.ts Removed relayUrl from test and example configs.
packages/torii-wasm/dojo.c Updated submodule reference to latest commit.
.changeset/wild-trees-admire.md Added changeset describing version bumps and rationale.
readme.md Removed relayUrl from SDK usage example and made minor formatting adjustments.

Sequence Diagram(s)

sequenceDiagram
    participant UserApp as User App
    participant SDK as Dojo SDK
    participant Client as Client (Torii)
    participant DojoC as dojo.c

    UserApp->>SDK: init({ toriiUrl, worldAddress })
    SDK->>Client: createClient({ toriiUrl, worldAddress })
    UserApp->>SDK: sendMessage(data, account?)
    SDK->>Client: publishMessage(data, signature)
    Client->>DojoC: publishMessage endpoint
    DojoC-->>Client: response (string)
    Client-->>SDK: Result<string, string>
    SDK-->>UserApp: Result<string, string>
Loading

Possibly related PRs

  • dojoengine/dojo.js#447: Updates the dojo.c subproject and Node.js worker example, directly relating to this PR's version bump and example changes.
  • dojoengine/dojo.js#357: Modifies the sendMessage method, similar to this PR's change in return type and removal of a related parameter.

Poem

A hop, a skip, the relay hops away,
Now configs are lighter, more streamlined today.
Messages return as strings, no bytes in the spring,
Dojo's code garden—tidier everything!
With every version bump and patch,
The rabbit smiles—another clean dispatch.
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.
    • @coderabbitai modularize this function.
  • 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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

@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: 0

🔭 Outside diff range comments (2)
packages/sdk/src/web/index.ts (1)

204-215: 🛠️ Refactor suggestion

Doc-comment return type is stale

The JSDoc still advertises Promise<void> while the implementation now returns Result<string,string>.

- * @returns {Promise<void>} - A promise that resolves when the message is sent successfully.
+ * @returns {Promise<Result<string,string>>} - Result containing the message ID or error.
packages/sdk/src/node/index.ts (1)

184-196: 🛠️ Refactor suggestion

Out-of-date JSDoc & unused parameter

  1. JSDoc still says Promise<void>; should reflect Result<string,string>.
  2. The _account parameter is unused—either use it or drop it to avoid confusion.
- * @returns {Promise<void>} - A promise that resolves when the message is sent successfully.
+ * @returns {Promise<Result<string,string>>} - Result containing the message ID or error.

If the account will never be used in the node context, consider removing it:

- sendMessage: async (data: TypedData, _account?: Account)
+ sendMessage: async (data: TypedData)
🧹 Nitpick comments (3)
.changeset/wild-trees-admire.md (1)

15-15: Missing determiner in the changeset headline

Nit-level grammar: add “the” before latest for smoother reading.

-chore: bump dojo.c to get latest publishMessage endpoint
+chore: bump dojo.c to get the latest publishMessage endpoint
🧰 Tools
🪛 LanguageTool

[uncategorized] ~15-~15: You might be missing the article “the” here.
Context: ...": patch --- chore: bump dojo.c to get latest publishMessage endpoint

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

readme.md (2)

197-199: Minor formatting glitches in bullet item

There’s an errant space before the colon and the sentence casing is inconsistent with neighbouring bullets.

- - Try out a specific example :
+ - Try out a specific example:

208-210: Inconsistent casing in heading

Consider capitalising “Docker” to match common convention.

- **With docker**:
+ **With Docker**:
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d58f2a3 and 989c381.

⛔ Files ignored due to path filters (4)
  • examples/example-vite-react-phaser-recs/src/dojo/generated/setup.ts is excluded by !**/generated/**
  • examples/example-vite-react-pwa-recs/src/dojo/generated/setup.ts is excluded by !**/generated/**
  • examples/example-vite-react-threejs-recs/src/dojo/generated/setup.ts is excluded by !**/generated/**
  • examples/example-vue-app-recs/src/dojo/generated/setup.ts is excluded by !**/generated/**
📒 Files selected for processing (18)
  • .changeset/wild-trees-admire.md (1 hunks)
  • examples/example-node-worker/main.ts (0 hunks)
  • examples/example-vanillajs-phaser-recs/src/dojo/setup.ts (0 hunks)
  • examples/example-vite-experimental-sdk/src/main.ts (0 hunks)
  • examples/example-vite-grpc-playground/src/main.tsx (0 hunks)
  • examples/example-vite-kitchen-sink/src/main.tsx (0 hunks)
  • examples/example-vite-phaser-sdk/src/main.ts (0 hunks)
  • examples/example-vite-react-app-recs/src/dojo/setup.ts (0 hunks)
  • examples/example-vite-react-sql/src/main.tsx (0 hunks)
  • examples/example-vite-svelte-recs/src/dojo/setup.ts (0 hunks)
  • packages/core/src/config/index.ts (0 hunks)
  • packages/sdk/src/__example__/index.ts (0 hunks)
  • packages/sdk/src/__tests__/generateTypedData.test.ts (0 hunks)
  • packages/sdk/src/internal/types.ts (1 hunks)
  • packages/sdk/src/node/index.ts (1 hunks)
  • packages/sdk/src/web/index.ts (1 hunks)
  • packages/torii-wasm/dojo.c (1 hunks)
  • readme.md (1 hunks)
💤 Files with no reviewable changes (12)
  • examples/example-vite-react-app-recs/src/dojo/setup.ts
  • examples/example-vite-kitchen-sink/src/main.tsx
  • examples/example-vite-react-sql/src/main.tsx
  • packages/sdk/src/example/index.ts
  • examples/example-vite-experimental-sdk/src/main.ts
  • packages/sdk/src/tests/generateTypedData.test.ts
  • examples/example-vite-svelte-recs/src/dojo/setup.ts
  • examples/example-node-worker/main.ts
  • examples/example-vite-grpc-playground/src/main.tsx
  • examples/example-vanillajs-phaser-recs/src/dojo/setup.ts
  • examples/example-vite-phaser-sdk/src/main.ts
  • packages/core/src/config/index.ts
🧰 Additional context used
🪛 LanguageTool
.changeset/wild-trees-admire.md

[uncategorized] ~15-~15: You might be missing the article “the” here.
Context: ...": patch --- chore: bump dojo.c to get latest publishMessage endpoint

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: check
🔇 Additional comments (4)
packages/torii-wasm/dojo.c (1)

1-1: Submodule pointer updated to latest commit
The dojo.c submodule reference has been correctly bumped to commit c9764dd0efd637932a86e24945ba22580e2892a4, aligning with the goal to incorporate the new publishMessage endpoint.

packages/sdk/src/internal/types.ts (1)

378-382:

✅ Verification successful

Breaking-change alert: sendMessage now returns Result<string, string>

Good to see the type aligned with the new publishMessage endpoint.
Please double-check that every consumer of SDK.sendMessage across the repo (examples, docs, downstream packages) is updated to handle the string payload instead of Uint8Array.


🏁 Script executed:

#!/bin/bash
# Find all usages of `sendMessage(` that still expect a Uint8Array
rg -n --context 2 $'sendMessage\\(' | grep -E "Uint8Array"

Length of output: 56


Confirmed: sendMessage consumers updated for string return

I searched all sendMessage( usages for any remaining Uint8Array references and found none. Consumers across the repo are now handling the string payload correctly. No further action required.

packages/sdk/src/web/index.ts (1)

53-55: relayUrl removed – verify config migration

defaultClientConfig now contains only toriiUrl.
Make sure:

  1. No lingering references to relayUrl remain in init() or downstream examples.
  2. Migration notes are added to the changelog / README so integrators aren’t surprised.
packages/sdk/src/node/index.ts (1)

40-42: relayUrl field dropped – update migration docs

Same concern as the web build: confirm all Node examples & tests removed relayUrl, and communicate the breaking config change.

@MartianGreed MartianGreed merged commit 04cd161 into main Jun 11, 2025
6 checks passed
@MartianGreed MartianGreed deleted the chore/bump-dojoc branch June 11, 2025 14:01
@coderabbitai coderabbitai bot mentioned this pull request Jun 12, 2025
5 tasks
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