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: ruby/json
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: ruby/json
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.7.x
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 20 commits
  • 15 files changed
  • 1 contributor

Commits on Oct 25, 2024

  1. Cleanup test_helper.rb

    byroot committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    c2cd953 View commit details
    Browse the repository at this point in the history
  2. Workaround rubygems $LOAD_PATH bug

    Ref: #647
    Ref: ruby/rubygems#6490
    
    Older rubygems are executing `extconf.rb` with a broken `$LOAD_PATH`
    causing the `json` gem native extension to be loaded with the stdlib
    version of the `.rb` files.
    
    This fails with
    
    ```
    json/common.rb:82:in `initialize': wrong number of arguments (given 1, expected 0) (ArgumentError)
    ```
    
    Since this is just for `extconf.rb` we can probably just accept that
    extra argument and ignore it.
    
    The bug was fixed in rubygems 3.4.9 / 2023-03-20
    byroot committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    a0cd1de View commit details
    Browse the repository at this point in the history
  3. Workaround being loaded alongside a different json_pure version

    Fix: #646
    
    Since both `json` and `json_pure` expose the same files, if the
    versions don't match, the native extension may be loaded with Ruby
    code that don't match and is incompatible.
    
    By doing the `require json/ext/generator/state` from C we ensure
    we're at least loading that.
    
    But this is a dirty workaround for the 2.7.x branch, we should
    find a better way to fully isolate the two gems.
    byroot committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    7fd3531 View commit details
    Browse the repository at this point in the history
  4. json_pure: fix ractor compatibility

    This actually never worked, because the test was always testing
    the ext version from the stdlib, never the pure version nor the
    current ext version.
    byroot committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    e285489 View commit details
    Browse the repository at this point in the history
  5. Update CHANGES

    byroot committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    10981db View commit details
    Browse the repository at this point in the history
  6. Merge pull request #648 from casperisfine/v2.7-rubygems-workaround

    Workaround rubygems $LOAD_PATH bug
    byroot authored Oct 25, 2024
    Configuration menu
    Copy the full SHA
    9e9b749 View commit details
    Browse the repository at this point in the history
  7. Release 2.7.4

    byroot committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    31a9100 View commit details
    Browse the repository at this point in the history
  8. Instantiate Parser with a kwsplat

    Prior to 2.7.3, `JSON::Ext::Parser` would only take kwargs.
    So if json_pure 2.7.4 is loaded with `json <= 2.7.2` (or stdlib)
    it blows up.
    
    Ref: #650
    Fix: #651
    byroot committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    4af0ea5 View commit details
    Browse the repository at this point in the history
  9. Merge pull request #652 from byroot/v2.7.x-pure-compat

    Instantiate Parser with a kwsplat
    byroot authored Oct 25, 2024
    Configuration menu
    Copy the full SHA
    04b43d2 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2024

  1. Handle all formatting configs potentially being nil.

    Fix: #653
    
    I don't think this was really fully supported in the past, but
    it kinda worked with some of the implementations.
    byroot committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    c318928 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #654 from casperisfine/v2.7.x-handle-nil-configs

    Handle all formatting configs potentially being `nil`.
    byroot authored Oct 28, 2024
    Configuration menu
    Copy the full SHA
    9d71186 View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2024

  1. Fix a memory leak in #to_json methods

    Fix: #460
    
    The various `to_json` methods must rescue exceptions
    to free the buffer.
    
    ```
    require 'json'
    
    data = 10_000.times.to_a << BasicObject.new
    20.times do
      100.times do
        begin
          data.to_json
        rescue NoMethodError
        end
      end
      puts `ps -o rss= -p #{$$}`
    end
    ```
    
    ```
     20128
     24992
     29920
     34672
     39600
     44336
     49136
     53936
     58816
     63616
     68416
     73232
     78032
     82896
     87696
     92528
     97408
    102208
    107008
    111808
    ```
    byroot committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    84c9aaa View commit details
    Browse the repository at this point in the history
  2. Release 2.7.5

    byroot committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    15afc68 View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2024

  1. JSON.generate: call to_json on String subclasses

    Fix: #667
    
    This is yet another behavior on which the various implementations
    differed, but the C implementation used to call `to_json` on String
    subclasses used as keys.
    
    This was optimized out in e125072
    but there is an Active Support test case for it, so it's best to
    make all 3 implementation respect this behavior.
    byroot committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    045e58d View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2024

  1. Configuration menu
    Copy the full SHA
    a0d6591 View commit details
    Browse the repository at this point in the history
  2. Fix test suite on JRuby

    byroot committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    e08d222 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2024

  1. Merge pull request #679 from casperisfine/generator-custom-base-types

    Add tests for the behavior of JSON.generate with base types subclasses
    byroot committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    987f59d View commit details
    Browse the repository at this point in the history
  2. Release 2.7.6

    byroot committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    e3a3695 View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2024

  1. Raise JSON::GeneratorError instead of Encoding::UndefinedConversionError

    Followup: #633
    
    That's what was raised historically. You could argue that this new
    exception is more precise, but I've encountered some real production
    code that expected the old behavior and that was broken by this change.
    byroot committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    2f76147 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #684 from byroot/v2.7.x-encoding-error

    [2.7.x] Raise JSON::GeneratorError instead of Encoding::UndefinedConversionError
    byroot authored Nov 5, 2024
    Configuration menu
    Copy the full SHA
    41cadbb View commit details
    Browse the repository at this point in the history
Loading