-
-
Notifications
You must be signed in to change notification settings - Fork 96
enhance: ImmutableJS support moved to /immutable export #3468
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
base: master
Are you sure you want to change the base?
Conversation
|
Size Change: -104 B (-0.13%) Total Size: 77.6 kB
ℹ️ View Unchanged
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3468 +/- ##
=======================================
Coverage 98.74% 98.75%
=======================================
Files 124 128 +4
Lines 2239 2247 +8
Branches 460 455 -5
=======================================
+ Hits 2211 2219 +8
Misses 13 13
Partials 15 15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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: 0e30d7c | Previous: c1c3fac | Ratio |
---|---|---|---|
normalizeLong |
521 ops/sec (±1.38% ) |
505 ops/sec (±1.36% ) |
0.97 |
infer All |
9409 ops/sec (±1.09% ) |
9093 ops/sec (±1.81% ) |
0.97 |
denormalizeLong |
277 ops/sec (±3.58% ) |
279 ops/sec (±3.36% ) |
1.01 |
denormalizeLong donotcache |
1000 ops/sec (±0.38% ) |
1000 ops/sec (±0.45% ) |
1 |
denormalizeShort donotcache 500x |
1480 ops/sec (±0.16% ) |
1438 ops/sec (±0.31% ) |
0.97 |
denormalizeShort 500x |
805 ops/sec (±2.25% ) |
787 ops/sec (±2.12% ) |
0.98 |
denormalizeShort 500x withCache |
6357 ops/sec (±0.54% ) |
5336 ops/sec (±0.24% ) |
0.84 |
queryShort 500x withCache |
2857 ops/sec (±0.31% ) |
2348 ops/sec (±0.23% ) |
0.82 |
denormalizeLong with mixin Entity |
269 ops/sec (±1.91% ) |
256 ops/sec (±1.98% ) |
0.95 |
denormalizeLong withCache |
7024 ops/sec (±0.23% ) |
6643 ops/sec (±0.26% ) |
0.95 |
denormalizeLong All withCache |
7184 ops/sec (±0.26% ) |
8191 ops/sec (±0.34% ) |
1.14 |
denormalizeLong Query-sorted withCache |
6877 ops/sec (±0.68% ) |
7915 ops/sec (±0.66% ) |
1.15 |
denormalizeLongAndShort withEntityCacheOnly |
1742 ops/sec (±0.44% ) |
1707 ops/sec (±0.46% ) |
0.98 |
getResponse |
6831 ops/sec (±0.77% ) |
6008 ops/sec (±1.28% ) |
0.88 |
getResponse (null) |
7548747 ops/sec (±0.84% ) |
5985961 ops/sec (±0.65% ) |
0.79 |
getResponse (clear cache) |
271 ops/sec (±1.97% ) |
259 ops/sec (±2.05% ) |
0.96 |
getSmallResponse |
3076 ops/sec (±0.41% ) |
2697 ops/sec (±0.29% ) |
0.88 |
getSmallInferredResponse |
2200 ops/sec (±0.53% ) |
2081 ops/sec (±0.10% ) |
0.95 |
getResponse Collection |
6558 ops/sec (±0.93% ) |
6830 ops/sec (±1.08% ) |
1.04 |
get Collection |
5902 ops/sec (±0.36% ) |
6065 ops/sec (±0.53% ) |
1.03 |
get Query-sorted |
7468 ops/sec (±0.30% ) |
6706 ops/sec (±0.30% ) |
0.90 |
setLong |
532 ops/sec (±0.22% ) |
498 ops/sec (±0.52% ) |
0.94 |
setLongWithMerge |
233 ops/sec (±0.41% ) |
230 ops/sec (±0.38% ) |
0.99 |
setLongWithSimpleMerge |
248 ops/sec (±0.23% ) |
243 ops/sec (±0.48% ) |
0.98 |
setSmallResponse 500x |
914 ops/sec (±0.32% ) |
920 ops/sec (±0.33% ) |
1.01 |
This comment was automatically generated by workflow using github-action-benchmark.
36683fd
to
a477670
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances ImmutableJS support by updating various components to use new Delegate patterns and adjusting related API calls. Key changes include:
- Consolidating type imports and modifying local cache retrievals.
- Replacing direct entity retrieval calls with new delegate calls in both normalization and denormalization.
- Updating tests to use the new delegate parameters for MemoCache queries.
Reviewed Changes
Copilot reviewed 41 out of 42 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/normalizr/src/denormalize/localCache.ts | Adjusted import refinements and non-null assertion on cache retrieval. |
packages/normalizr/src/denormalize/getEntities.ts | Updated delegate usage and return type to support symbol keys. |
packages/normalizr/src/denormalize/denormalize.ts | Replaced getEntities call with PlainDelegate and removed isImmutable flag from getUnvisit. |
packages/normalizr/src/denormalize/denormalize.immutable.ts | Added new immutable-specific denormalization implementation. |
packages/normalizr/src/denormalize/cache.ts | Simplified type imports. |
packages/normalizr/src/denormalize/UNDEF.ts | Updated UNDEF constant with type assertion to any. |
Various test files | Updated MemoCache instantiation and delegate usage in tests. |
packages/endpoint and packages/core files | Refactored entity lookup and GCPolicy iteration using destructuring for clarity. |
packages/endpoint/src/interface.ts | Expanded IQueryDelegate and INormalizeDelegate definitions to include getEntities. |
packages/endpoint/src/index.ts | Re-exported all interface types for consistency. |
Files not reviewed (1)
- packages/normalizr/package.json: Language not supported
Comments suppressed due to low confidence (1)
packages/normalizr/src/denormalize/denormalize.ts:19
- The removal of the isImmutable(entities) argument in the getUnvisit call may alter the behavior if getUnvisit depends on this flag for handling immutable data. Please verify that this change is intentional and that getUnvisit no longer requires an explicit immutable indicator.
return getUnvisit(PlainDelegate.forDenorm(entities), new LocalCache(), args, )(schema, input).data;
BREAKING CHANGE: To use
Follow up to #3449
Motivation
Solution