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

enhance: Queries passthrough suspense rather than being undefined #3017

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

ntucker
Copy link
Collaborator

@ntucker ntucker commented Apr 24, 2024

Motivation

Allow queries to be used in endpoints.

Solution

Queries pass-through suspense rather than ever being undefined

  • useSuspense() return values will not be nullable
  • useQuery() will still be nullable due to it handling INVALID as undefined return
  • Query.process does not need to handle nullable cases

Copy link

changeset-bot bot commented Apr 24, 2024

🦋 Changeset detected

Latest commit: 67064c7

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

This PR includes changesets to release 8 packages
Name Type
@data-client/endpoint Patch
@data-client/rest Patch
@data-client/graphql Patch
example-benchmark Patch
normalizr-github-example Patch
normalizr-redux-example Patch
normalizr-relationships Patch
rdc-website 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: 67064c7 Previous: 88d6d5d Ratio
normalizeLong 478 ops/sec (±0.37%) 472 ops/sec (±0.45%) 0.99
infer All 9717 ops/sec (±1.18%) 9416 ops/sec (±1.66%) 0.97
denormalizeLong 319 ops/sec (±2.32%) 321 ops/sec (±3.09%) 1.01
denormalizeLong donotcache 815 ops/sec (±1.65%) 838 ops/sec (±0.40%) 1.03
denormalizeShort donotcache 500x 1351 ops/sec (±0.15%) 1328 ops/sec (±0.43%) 0.98
denormalizeShort 500x 925 ops/sec (±0.29%) 951 ops/sec (±0.24%) 1.03
denormalizeShort 500x withCache 5189 ops/sec (±0.25%) 5177 ops/sec (±0.25%) 1.00
denormalizeLong with mixin Entity 298 ops/sec (±0.57%) 305 ops/sec (±0.44%) 1.02
denormalizeLong withCache 6642 ops/sec (±0.22%) 6280 ops/sec (±0.17%) 0.95
denormalizeLong All withCache 6308 ops/sec (±0.11%) 6618 ops/sec (±0.22%) 1.05
denormalizeLong Query-sorted withCache 6507 ops/sec (±0.17%) 6542 ops/sec (±0.32%) 1.01
denormalizeLongAndShort withEntityCacheOnly 1553 ops/sec (±0.25%) 1490 ops/sec (±0.51%) 0.96
getResponse 5013 ops/sec (±1.22%) 5014 ops/sec (±1.11%) 1.00
getResponse (null) 5250274 ops/sec (±0.47%) 5059115 ops/sec (±0.42%) 0.96
getResponse (clear cache) 288 ops/sec (±0.74%) 290 ops/sec (±1.15%) 1.01
getSmallResponse 2557 ops/sec (±0.45%) 2471 ops/sec (±0.19%) 0.97
getSmallInferredResponse 1818 ops/sec (±0.28%) 1814 ops/sec (±0.22%) 1.00
getResponse Query-sorted 4664 ops/sec (±0.12%) 4573 ops/sec (±0.33%) 0.98
getResponse Collection 4658 ops/sec (±0.39%) 5742 ops/sec (±1.41%) 1.23
get Collection 4317 ops/sec (±0.41%) 5194 ops/sec (±0.37%) 1.20
setLong 477 ops/sec (±0.27%) 467 ops/sec (±0.46%) 0.98
setLongWithMerge 190 ops/sec (±0.32%) 193 ops/sec (±0.40%) 1.02
setLongWithSimpleMerge 203 ops/sec (±0.32%) 203 ops/sec (±0.23%) 1
setSmallResponse 500x 853 ops/sec (±0.31%) 839 ops/sec (±0.36%) 0.98

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

@ntucker ntucker force-pushed the query-suspense branch 2 times, most recently from 6afbdef to c5d1403 Compare April 24, 2024 23:05
Copy link

codecov bot commented Apr 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.49%. Comparing base (5469db0) to head (67064c7).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3017   +/-   ##
=======================================
  Coverage   98.49%   98.49%           
=======================================
  Files         122      122           
  Lines        2186     2186           
  Branches      439      439           
=======================================
  Hits         2153     2153           
  Misses         21       21           
  Partials       12       12           

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

@ntucker ntucker force-pushed the query-suspense branch 3 times, most recently from 6a9d769 to 6e08451 Compare April 24, 2024 23:37
@ntucker ntucker marked this pull request as ready for review April 25, 2024 00:21
@ntucker ntucker changed the title enhance: Queries passthrough suspense rather than converting to undefined enhance: Queries passthrough suspense rather than being undefined Apr 25, 2024
@ntucker ntucker merged commit ce164d2 into master Apr 25, 2024
25 checks passed
@ntucker ntucker deleted the query-suspense branch April 25, 2024 00:34
@github-actions github-actions bot mentioned this pull request Apr 25, 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.

None yet

1 participant