Skip to content

Merge upstream master into the fork - #8

Merged
njakobsen merged 7 commits into
masterfrom
sync-upstream-2026-10
Oct 21, 2026
Merged

njakobsen merged 7 commits into
masterfrom
sync-upstream-2026-10

Conversation

@njakobsen

Copy link
Copy Markdown
Member

Summary

Brings the fork's master up to upstream master (59e1ef0f), ahead of an upstream gem release, so the fork's users run upstream's latest code before it ships.

The merge had no conflicts. Apart from the dropped line, the tree differs from upstream's only by the fork's nested documents work (#4).

#6 and #7 have this merged in, so stolo_connect and Glint run upstream's changes through them.

Test plan

🤖 Generated with Claude Code

https://claude.ai/code/session_01TAYgm5SknHTiRNTgGA6LBY

sampokuokkanen and others added 7 commits September 9, 2026 21:56
ActiveSupport passes quirks_mode to JSON.generate and JSON.parse. json 3
made unknown options an ArgumentError, so Sunspot.remove_all! in
spec_helper blows up and every sunspot_rails spec fails with it.

Rails 8 dropped quirks_mode, but the Appraisals file stops at Rails 7.0, so
nothing in the matrix can run on json 3. Pinning it as a development
dependency, next to the psych pin that is already there for the same kind
of reason.
The quirks_mode incompatibility depends on the Rails version, so pin
json next to the other version-specific gems instead of in the gemspec,
and correct the comment: 8.0.x still passes quirks_mode; only 7.2.4+
and 8.1+ don't.
Pin `json` below 3 for the sunspot_rails suite
ContextBoundDelegate tries the receiver first and falls back to the calling
context in a rescue, so every DSL call that belongs to the calling context
raises a NoMethodError whose backtrace is then thrown away.

Raising captures the whole stack at roughly 3 objects per frame, and a
Rails request is already ~182 frames deep inside a search block, so each
raise costs ~600 objects. In our app a block calling a few model helpers
raised 70 times per request; dropping those took the request from 288,801
to 246,807 objects allocated, 14.6% less.

The fast path uses respond_to? to dispatch straight to the calling context.
Where respond_to? can't answer, method_missing without respond_to_missing?
being the obvious case, it falls through to the old path.
The respond_to? fast path let the calling context win over receivers
that handle calls in method_missing without respond_to_missing?, such
as DSL::Function (function { sum(...) } in a model class method) and
DSL::Fields (double inside an RSpec example). It also called
respond_to? on BasicObject receivers that don't have it.

Only take the fast path when the receiver has Kernel, doesn't respond
to the method and uses the default method_missing, so it could only
have raised. Add specs for each case, and only count raises on the
test thread.
…or-in-dsl-dispatch

Avoid NoMethodError when resolving DSL calls
Brings in sunspot#1057, which avoids a `NoMethodError` when the DSL resolves a call against a receiver, and sunspot#1058, which pins `json` below 3 in the `sunspot_rails` appraisals, ahead of an upstream gem release.

Upstream's json pin supersedes the fork's own from #5, which pinned only the Rails 6.1 and 7.0 appraisals, so the fork's line is dropped and `sunspot_rails/Appraisals` now equals upstream's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TAYgm5SknHTiRNTgGA6LBY
@njakobsen
njakobsen marked this pull request as ready for review October 21, 2026 16:45
@njakobsen
njakobsen merged commit 42cceea into master Oct 21, 2026
110 checks passed
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