Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Collections work with nested args #3281

Merged
merged 1 commit into from
Nov 24, 2024
Merged

Conversation

ntucker
Copy link
Collaborator

@ntucker ntucker commented Nov 24, 2024

Fixes #3280 .

Motivation

Handle nested object args when using Collections.

Solution

Stop strinigfying all values in Collection.pk() - only do this for number and booleans.

Originally this was added in ca249b5#diff-92c9afa78291c2d6c55ee59b03d774c70f8ff00d4a93120c494d6f5498b50b59R107 to normalize serialization even when strings are substituted for numbers, etc. However, this doesn't make sense for other types like objects.

Copy link

changeset-bot bot commented Nov 24, 2024

🦋 Changeset detected

Latest commit: 554931e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@data-client/endpoint Patch
@data-client/graphql Patch
@data-client/rest Patch
example-benchmark Patch
normalizr-github-example Patch
normalizr-redux-example Patch
normalizr-relationships Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 554931e Previous: fa8f600 Ratio
normalizeLong 516 ops/sec (±0.29%) 509 ops/sec (±0.30%) 0.99
infer All 9353 ops/sec (±0.40%) 9169 ops/sec (±0.54%) 0.98
denormalizeLong 266 ops/sec (±2.75%) 266 ops/sec (±2.48%) 1
denormalizeLong donotcache 903 ops/sec (±0.39%) 880 ops/sec (±0.90%) 0.97
denormalizeShort donotcache 500x 1364 ops/sec (±0.30%) 1346 ops/sec (±0.18%) 0.99
denormalizeShort 500x 790 ops/sec (±1.80%) 777 ops/sec (±2.12%) 0.98
denormalizeShort 500x withCache 4882 ops/sec (±0.51%) 4750 ops/sec (±0.65%) 0.97
denormalizeLong with mixin Entity 255 ops/sec (±2.01%) 251 ops/sec (±2.04%) 0.98
denormalizeLong withCache 7568 ops/sec (±0.25%) 6996 ops/sec (±0.11%) 0.92
denormalizeLong All withCache 6585 ops/sec (±0.22%) 6370 ops/sec (±0.79%) 0.97
denormalizeLong Query-sorted withCache 6425 ops/sec (±0.64%) 6222 ops/sec (±0.83%) 0.97
denormalizeLongAndShort withEntityCacheOnly 1654 ops/sec (±0.21%) 1609 ops/sec (±0.31%) 0.97
getResponse 5632 ops/sec (±0.25%) 5858 ops/sec (±1.02%) 1.04
getResponse (null) 5365409 ops/sec (±0.42%) 5192436 ops/sec (±0.65%) 0.97
getResponse (clear cache) 255 ops/sec (±1.89%) 251 ops/sec (±1.80%) 0.98
getSmallResponse 2649 ops/sec (±0.34%) 2569 ops/sec (±0.26%) 0.97
getSmallInferredResponse 2023 ops/sec (±0.19%) 2112 ops/sec (±0.30%) 1.04
getResponse Query-sorted 6784 ops/sec (±0.18%) 6366 ops/sec (±0.81%) 0.94
getResponse Collection 6341 ops/sec (±0.72%) 6887 ops/sec (±1.00%) 1.09
get Collection 5562 ops/sec (±0.57%) 6152 ops/sec (±0.34%) 1.11
setLong 514 ops/sec (±0.45%) 511 ops/sec (±0.30%) 0.99
setLongWithMerge 204 ops/sec (±0.39%) 202 ops/sec (±0.19%) 0.99
setLongWithSimpleMerge 216 ops/sec (±0.44%) 212 ops/sec (±0.34%) 0.98
setSmallResponse 500x 898 ops/sec (±0.34%) 909 ops/sec (±0.27%) 1.01

This comment was automatically generated by workflow using github-action-benchmark.

Copy link

codecov bot commented Nov 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.94%. Comparing base (723e79b) to head (554931e).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3281   +/-   ##
=======================================
  Coverage   98.94%   98.94%           
=======================================
  Files         132      132           
  Lines        2281     2281           
  Branches      467      467           
=======================================
  Hits         2257     2257           
  Misses         13       13           
  Partials       11       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@ntucker ntucker force-pushed the collection-args-serialization branch from 73045dd to 17d25be Compare November 24, 2024 13:38
@ntucker ntucker force-pushed the collection-args-serialization branch from 17d25be to 554931e Compare November 24, 2024 13:52
@ntucker ntucker merged commit 99cd041 into master Nov 24, 2024
25 checks passed
@ntucker ntucker deleted the collection-args-serialization branch November 24, 2024 14:08
@github-actions github-actions bot mentioned this pull request Nov 24, 2024
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.

Nested query params handled via qs library don't trigger request when changed
1 participant