Skip to content

V2: Misc fixes and gotchas - #618

Merged
jhollinger merged 11 commits into
release-2.0from
jh/release-2.0-misc-fixes
Nov 5, 2026
Merged

jhollinger merged 11 commits into
release-2.0from
jh/release-2.0-misc-fixes

Conversation

@jhollinger

@jhollinger jhollinger commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

While developing a V1-V2 migration skill, I (Claude) found several bugs and gotchas. This PR fixes or improves them in bulk:

  • Fixed unexpected behavior for default values (they shouldn't be run through formatters or, especially, through serializers).
  • Made format respect child classes, which is probably what users would expect.
  • Resolved a mismatch between V1 and V2's default_if behavior.
  • Fixed numerous behavior differences in LegacyOptions with respect to V1's actual behavior.
  • Bugfix to LegacyDynamicOptions.
  • render now treats Struct as an object instead of a collection.
  • Replace an internal field options Hash with struct members - faster lookup and one less allocation per field.
  • Misc improvements in docs/v2.

@jhollinger
jhollinger force-pushed the jh/release-2.0-misc-fixes branch 2 times, most recently from a098202 to c610c56 Compare October 29, 2026 15:13
@jhollinger
jhollinger added this pull request to stack #620 October 29, 2026 15:34
@jhollinger
jhollinger marked this pull request as ready for review October 29, 2026 15:34
@jhollinger
jhollinger requested review from a team and ritikesh as code owners October 29, 2026 15:34
jhollinger and others added 10 commits November 4, 2026 17:05
Signed-off-by: Jordan Hollinger <jordan.hollinger@procore.com>
Signed-off-by: Jordan Hollinger <jordan.hollinger@procore.com>
Signed-off-by: Jordan Hollinger <jordan.hollinger@procore.com>
Signed-off-by: Jordan Hollinger <jordan.hollinger@procore.com>
V2 now behaves like V1: if `default_if` is present, that's the only
factor in deciding to use `default`. Otherwise it's a nil check.

Signed-off-by: Jordan Hollinger <jordan.hollinger@procore.com>
Signed-off-by: Jordan Hollinger <jordan.hollinger@procore.com>
Signed-off-by: Jordan Hollinger <jordan.hollinger@procore.com>
Signed-off-by: Jordan Hollinger <jordan.hollinger@procore.com>
Struct includes Enumerable, so `render` was routing Structs through
`render_collection` and iterating their members. The collection
heuristic now lives in `V2::Rendering::NON_COLLECTIONS` and the shared
`V2::Rendering.collection?` predicate, which AssociationExtractor's
V1-to-V2 bridge uses too (it had its own copy of the old check).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Jordan Hollinger <jordan.hollinger@procore.com>
…p and one less allocation per field

Signed-off-by: Jordan Hollinger <jordan.hollinger@procore.com>
@jhollinger
jhollinger force-pushed the jh/release-2.0-misc-fixes branch from 500cedd to 8edf324 Compare November 4, 2026 22:08
Signed-off-by: Jordan Hollinger <jordan.hollinger@procore.com>
@jhollinger
jhollinger force-pushed the jh/release-2.0-misc-fixes branch from 78c2e41 to 4b70a07 Compare November 4, 2026 22:12
@jhollinger
jhollinger merged commit 55512e9 into release-2.0 Nov 5, 2026
4 checks passed
@jhollinger
jhollinger deleted the jh/release-2.0-misc-fixes branch November 5, 2026 02:09
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