Skip to content

[2.x] Merge prop#23

Draft
adrum wants to merge 43 commits intokapi2289:mainfrom
adrum:feature/merge-prop
Draft

[2.x] Merge prop#23
adrum wants to merge 43 commits intokapi2289:mainfrom
adrum:feature/merge-prop

Conversation

@adrum
Copy link
Copy Markdown
Contributor

@adrum adrum commented Dec 21, 2024

@adrum adrum mentioned this pull request Dec 21, 2024
10 tasks
@adrum adrum marked this pull request as draft December 21, 2024 19:45
@adrum adrum mentioned this pull request Dec 21, 2024
@kapi2289 kapi2289 added this to the v2.0.0 milestone Jan 3, 2025
kapi2289 and others added 6 commits January 6, 2025 17:29
# Conflicts:
#	InertiaCore/Extensions/Configure.cs
#	InertiaCore/Extensions/InertiaExtensions.cs
#	InertiaCore/Response.cs
#	InertiaCore/ResponseFactory.cs
#	InertiaCore/Utils/AlwaysProp.cs
#	InertiaCore/Utils/LocationResult.cs
#	InertiaCoreTests/UnitTestAlwaysData.cs
# Conflicts:
#	InertiaCore/Extensions/Configure.cs
#	InertiaCore/Extensions/InertiaExtensions.cs
#	InertiaCore/Inertia.cs
#	InertiaCore/Response.cs
#	InertiaCore/ResponseFactory.cs
#	InertiaCore/Utils/AlwaysProp.cs
#	InertiaCore/Utils/LocationResult.cs
#	InertiaCoreTests/UnitTestAlwaysData.cs
# Conflicts:
#	InertiaCore/Props/LazyProp.cs
#	InertiaCore/Response.cs
adrum and others added 17 commits January 10, 2025 21:32
# Conflicts:
#	InertiaCore/Response.cs
# Conflicts:
#	.github/workflows/dotnet.yml
#	InertiaCore/Response.cs
#	InertiaCore/ResponseFactory.cs
# Conflicts:
#	.github/workflows/dotnet.yml
#	InertiaCore/Extensions/InertiaExtensions.cs
#	InertiaCore/Inertia.cs
#	InertiaCore/Response.cs
#	InertiaCore/ResponseFactory.cs
# Conflicts:
#	InertiaCore/Models/Page.cs
#	InertiaCore/ResponseFactory.cs
Mirror the canonical Inertia Laravel adapter's merge prop resolution
so the wire format and filtering semantics stay in sync with the
Inertia.js frontend contract.

- Extend Mergeable with Append/AppendsAtPaths/PrependsAtPaths plus
  AppendAt/PrependAt/Prepend helpers and AppendsAtRoot/PrependsAtRoot
  predicates for directional merging at nested paths.
- Add PrependProps to the Page model and change MatchPropsOn from
  Dictionary<string, string[]> to a flat List<string> of "key.strategy"
  entries, matching Laravel's resolveMergeMatchingKeys output.
- Add GetMergeablePropsForRequest in Response that filters _props by
  Mergeable + ShouldMerge, then rejects Reset keys and applies
  Partial-Only / Partial-Except in one pass. All four Resolve methods
  operate on that pre-filtered collection, removing the duplicated
  header parsing that previously lived in each method.
- Cover the Reset-header interaction with a new test that asserts a
  prop listed in X-Inertia-Reset is excluded from mergeProps.
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