Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sambostock/mcp-ruby-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: data
Choose a base ref
...
head repository: sambostock/mcp-ruby-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: data-define
Choose a head ref
  • 1 commit
  • 14 files changed
  • 1 contributor

Commits on Jun 11, 2025

  1. [DO NOT MERGE] Try Data.define

    Exploring using `Data.define` instead of our own classes. This has a
    number of pros & cons:
    
    - Marginally less code (depends on each case)
    - Increased API surface
      - This is both a pro & con: we get some methods for free, but that
        means they'll be part of our public API and we'll need to continue
        supporting them (e.g. `.[]` to construct instances).
    - Loss of ability to subclass `Content` (AFAICT)
    - Violating Liskov Substitution (child changes parent's contract)
      - e.g. `Data#to_h` has certain semantics and complements `initialize`.
             We customize `Data#to_h` to return `camelCase` values, and omit
    	 things like `@block`.
    - Unable to mix positional and keyword arguments: the `new` method
      provided by `Data` expects either all positional or all keyword
      arguments, and ALWAYS passes them to `initialize` as keywords. This is
      incompatible with the API we offer for classes like `Content::Text`,
      which expects a positional `text` argument, and an optional keyword
      `annotations:` argument.
    sambostock committed Jun 11, 2025
    Configuration menu
    Copy the full SHA
    c3ab6fd View commit details
    Browse the repository at this point in the history
Loading