Skip to content

enhance: MemoCache.query() and MemoCache.buildQueryKey() take state as one argument #3454

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

Merged
merged 1 commit into from
Apr 7, 2025

Conversation

ntucker
Copy link
Collaborator

@ntucker ntucker commented Apr 7, 2025

BREAKING CHANGE: MemoCache.query() and MemoCache.buildQueryKey() take state as one argument

Before

this.memo.buildQueryKey(
  schema,
  args,
  state.entities,
  state.indexes,
  key,
);

After

this.memo.buildQueryKey(
  schema,
  args,
  state,
  key,
);

Before

this.memo.query(schema, args, state.entities, state.indexes);

After

this.memo.query(schema, args, state);

Copy link

changeset-bot bot commented Apr 7, 2025

🦋 Changeset detected

Latest commit: 9b94b36

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

This PR includes changesets to release 11 packages
Name Type
@data-client/normalizr Major
@data-client/core Major
example-benchmark Patch
normalizr-github-example Patch
normalizr-redux-example Patch
normalizr-relationships Patch
@data-client/react Major
@data-client/img Major
@data-client/test Major
test-bundlesize Patch
coinbase-lite 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 bot commented Apr 7, 2025

Size Change: -7 B (-0.01%)

Total Size: 77.8 kB

ℹ️ View Unchanged
Filename Size Change
examples/test-bundlesize/dist/App.js 3.42 kB 0 B
examples/test-bundlesize/dist/polyfill.js 311 B 0 B
examples/test-bundlesize/dist/rdcClient.js 10.2 kB -7 B (-0.07%)
examples/test-bundlesize/dist/rdcEndpoint.js 5.65 kB 0 B
examples/test-bundlesize/dist/react.js 57.5 kB 0 B
examples/test-bundlesize/dist/webpack-runtime.js 726 B 0 B

compressed-size-action

Copy link

codecov bot commented Apr 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.79%. Comparing base (8e0bba2) to head (9b94b36).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3454   +/-   ##
=======================================
  Coverage   98.79%   98.79%           
=======================================
  Files         125      125           
  Lines        2241     2241           
  Branches      459      459           
=======================================
  Hits         2214     2214           
  Misses         13       13           
  Partials       14       14           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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: 9b94b36 Previous: 4939456 Ratio
normalizeLong 506 ops/sec (±0.35%) 503 ops/sec (±0.71%) 0.99
infer All 9072 ops/sec (±1.37%) 9258 ops/sec (±1.36%) 1.02
denormalizeLong 254 ops/sec (±2.84%) 275 ops/sec (±2.25%) 1.08
denormalizeLong donotcache 982 ops/sec (±0.38%) 1010 ops/sec (±0.31%) 1.03
denormalizeShort donotcache 500x 1426 ops/sec (±0.16%) 1408 ops/sec (±0.47%) 0.99
denormalizeShort 500x 747 ops/sec (±2.38%) 777 ops/sec (±2.27%) 1.04
denormalizeShort 500x withCache 5261 ops/sec (±0.19%) 5203 ops/sec (±0.22%) 0.99
queryShort 500x withCache 2306 ops/sec (±0.44%) 2302 ops/sec (±0.28%) 1.00
denormalizeLong with mixin Entity 245 ops/sec (±1.99%) 258 ops/sec (±1.96%) 1.05
denormalizeLong withCache 6779 ops/sec (±0.25%) 6928 ops/sec (±0.17%) 1.02
denormalizeLong All withCache 6825 ops/sec (±0.27%) 7201 ops/sec (±0.36%) 1.06
denormalizeLong Query-sorted withCache 6380 ops/sec (±1.02%) 6818 ops/sec (±0.92%) 1.07
denormalizeLongAndShort withEntityCacheOnly 1677 ops/sec (±0.38%) 1703 ops/sec (±0.44%) 1.02
getResponse 6028 ops/sec (±1.03%) 6061 ops/sec (±1.39%) 1.01
getResponse (null) 5568305 ops/sec (±0.61%) 5139703 ops/sec (±0.53%) 0.92
getResponse (clear cache) 244 ops/sec (±2.11%) 261 ops/sec (±2.08%) 1.07
getSmallResponse 2388 ops/sec (±0.30%) 2679 ops/sec (±0.30%) 1.12
getSmallInferredResponse 2062 ops/sec (±0.34%) 2096 ops/sec (±0.35%) 1.02
getResponse Collection 6472 ops/sec (±1.02%) 6530 ops/sec (±0.96%) 1.01
get Collection 5624 ops/sec (±0.37%) 5950 ops/sec (±0.45%) 1.06
get Query-sorted 6851 ops/sec (±0.26%) 6735 ops/sec (±0.31%) 0.98
setLong 491 ops/sec (±0.42%) 508 ops/sec (±0.38%) 1.03
setLongWithMerge 218 ops/sec (±0.75%) 228 ops/sec (±0.32%) 1.05
setLongWithSimpleMerge 231 ops/sec (±0.59%) 240 ops/sec (±0.46%) 1.04
setSmallResponse 500x 898 ops/sec (±0.31%) 919 ops/sec (±0.32%) 1.02

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

@ntucker ntucker merged commit 66e1906 into master Apr 7, 2025
23 checks passed
@ntucker ntucker deleted the memo-args branch April 7, 2025 20:07
@github-actions github-actions bot mentioned this pull request Apr 7, 2025
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.

1 participant