Bump multi_json from 1.19.1 to 1.21.1
Type: Pull Request
State: Open
Association: Unknown
Comments: 2
(about 2 months ago)
(about 2 months ago)
dependencies ruby
Bumps multi_json from 1.19.1 to 1.21.1.
Release notes
Sourced from multi_json's releases.
v1.21.1
Full Changelog: https://github.com/sferik/multi_json/compare/v1.21.0...v1.21.1
v1.21.0
Full Changelog: https://github.com/sferik/multi_json/compare/v1.20.1...v1.21.0
Changelog
Sourced from multi_json's changelog.
[1.21.1]
Fixed
- Fix
MultiJson.method(:load)resolving toKernel#loadinstead of the legacy-constant forwarder (#66). The 1.21.0 shim forwarded calls viamethod_missing, butModule#methoddoesn't consultmethod_missing, so libraries that capture decoders asMethodobjects (Sawyer, used by Octokit and Danger) crashed withLoadErrorwhen the captured method tried to interpret the JSON string as a file path. Define an explicit singleton method onMultiJsonfor every public methodMultiJSONexposes soModule#methodfinds the forwarder directly.[1.21.0]
Every deprecation introduced here will be removed in
2.0.0. Upgrade to1.21.0, run your app or test suite withruby -W:deprecatedto surface the warnings, migrate each call site to the new canonical names, then pin~> 2.0once2.0.0ships.Added
- Rename the
MultiJsonconstant toMultiJSON(all-caps) to match the project name, Ruby stdlibJSON, and the all-caps treatment of the JSON acronym across other languages. The legacyMultiJsonconstant continues to work as a thin delegator viamethod_missingandconst_missing, soMultiJson.parse(...),MultiJson::Adapters::Oj, andrescue MultiJson::ParseErrorall resolve to theirMultiJSONcounterparts.- Add
MultiJSON.parseandMultiJSON.generateas the new canonical names for the primary parse and generate methods, matching Ruby stdlibJSON.parse/JSON.generate, the JSON spec (RFC 8259), and sister library MultiXml.- Add
MultiJSON.parse_options/MultiJSON.parse_options=andMultiJSON.generate_options/MultiJSON.generate_options=as the new canonical option setters.- Accept
symbolize_names:as the canonical option name matching Ruby stdlib'sJSON.parse(str, symbolize_names: true). The deprecatedsymbolize_keys:option continues to work and emits a one-time warning when passed at any of the three option layers (call-site,MultiJSON.parse_options=, adapterdefaults :load).- Replace the two-adapter
Benchmark.ipssmoke test inbenchmark.rbwith a full adapter comparison matrix (parse+dumpacross nine workloads) and promote it to a top-levelrake benchmarktask. A new--verify-preferenceflag asserts thatMultiJSON::AdapterSelector::ADAPTERSmatches the observed throughput ranking, with a 10% tolerance for adjacent ties; CI runs it on every push so the ordering can't silently drift.Changed
- Reorder
MultiJSON::AdapterSelector::ADAPTERSso the JSON gem is tried beforefast_jsonparser/oj/yajlon MRI and TruffleRuby, matching the throughput ranking in the bundled benchmark suite on Ruby 3.4+. The hash is split per platform so JRuby still prefersjr_jackson. Affects auto-detection only when more than one of those adapters is loaded; explicitly selecting an adapter withMultiJSON.use(:adapter)is unchanged.Deprecated
- The
MultiJsonconstant in favor ofMultiJSON.MultiJSON.loadin favor ofMultiJSON.parse.MultiJSON.dumpin favor ofMultiJSON.generate.MultiJSON.load_options/MultiJSON.load_options=in favor ofMultiJSON.parse_options/MultiJSON.parse_options=.MultiJSON.dump_options/MultiJSON.dump_options=in favor ofMultiJSON.generate_options/MultiJSON.generate_options=.- The
:symbolize_keysparse option in favor of:symbolize_names.All deprecated names continue to work and emit a one-time warning on first use. Warnings are tagged with Ruby's
:deprecatedcategory, so noisy apps can silence the whole set withWarning[:deprecated] = falseand deprecation-aware tooling (ruby -W:deprecated, CI linters) picks them up. The old names will be removed in 2.0.[1.20.1]
Fixed
- Fix
JsonGem#loadraisingParseErroron ASCII-8BIT strings that contain valid UTF-8 bytes (#64). Ruby HTTP clients tag response bodies as ASCII-8BIT by default; the 1.20.0 change fromforce_encodingtoencodebroke the dominant real-world case by trying to transcode each byte individually. Switch back toforce_encodingfollowed by avalid_encoding?guard so genuinely invalid byte sequences still surface asParseError.Added
- Validate custom adapters during
MultiJson.useandMultiJson.load/dumpwith an:adapteroption, raisingMultiJson::AdapterErrorimmediately if the adapter does not respond to.load,.dump, or define aParseErrorconstant.- Validate
OptionsCache.max_cache_size=to rejectnil, zero, negative, and non-integer values with a clearArgumentError.- Expand the benchmark suite (
benchmark.rb) into a full adapter comparison matrix covering load, dump, and round-trip across small, medium, and large payloads in both object-heavy and array-heavy shapes.[1.20.0]
Added
- Surface parse error locations as
error.lineanderror.columnonMultiJson::ParseError, extracted from the underlying adapter's message for adapters that include one (Oj, the json gem).
... (truncated)
Commits
9ae5a42Version 1.21.1f3604c5Fix MultiJson.method(:load) resolving to Kernel#load8339719Version 1.21.02217775Tag deprecation warnings as :deprecated and document the bridge in the README6f6b756Reorder ADAPTERS by benchmark throughput and verify the order in CI72d3ea1Add adapter benchmark suite as a rake task112d0afMirror stdlib JSON in the public API: MultiJSON, parse/generate, symbolize_namesddc802aRewrite CHANGELOG in Keep a Changelog formatd4c6fe1Whitelist gemspec files instead of globbing all .md filesc50c595Fix flaky symbol-count tests that fail when GC reclaims symbols- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Package Dependencies
Technical Details
| ID: | 15659222 |
| UUID: | 4381178778 |
| Node ID: | PR_kwDOR-g9jc7YPrAS |
| Host: | GitHub |
| Repository: | ruby-benchmark/errbit |