Repository navigation
fix(core): Resolve mock fixture types without @data-client/endpoint - #4420
Conversation
core/mock fixture types imported EndpointInterface and ResolveType from @data-client/endpoint, which core doesn't depend on; import them from core itself. Also raise @data-client/test's @data-client/react peer floor to ^0.15.3, the first release whose /mock subpath loads under CommonJS. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWrXQsPLEpjGyPxXxv8Yhc
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
🦋 Changeset detectedLatest commit: 6d12492 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4420 +/- ##
=======================================
Coverage 98.37% 98.37%
=======================================
Files 161 161
Lines 3072 3072
Branches 604 604
=======================================
Hits 3022 3022
Misses 10 10
Partials 40 40 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… core Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWrXQsPLEpjGyPxXxv8Yhc
|
Docs preview: https://docs-site-pr-4420-data-client.vercel.app Built from 6d12492 merged into |
There was a problem hiding this comment.
Benchmark React
Details
| Benchmark suite | Current: 6d12492 | Previous: dc61f24 | Ratio |
|---|---|---|---|
data-client: getlist-100 |
198.04 ops/s (± 7.8%) |
194.19 ops/s (± 7.6%) |
0.98 |
data-client: getlist-500 |
63.09 ops/s (± 5.0%) |
76.92 ops/s (± 4.4%) |
1.22 |
data-client: update-entity |
363.76 ops/s (± 8.0%) |
555.56 ops/s (± 9.4%) |
1.53 |
data-client: update-user |
400 ops/s (± 5.0%) |
666.67 ops/s (± 10.7%) |
1.67 |
data-client: getlist-500-sorted |
56.67 ops/s (± 7.1%) |
74.36 ops/s (± 8.9%) |
1.31 |
data-client: update-entity-sorted |
363.76 ops/s (± 9.2%) |
513.16 ops/s (± 9.3%) |
1.41 |
data-client: update-entity-multi-view |
384.62 ops/s (± 5.6%) |
555.56 ops/s (± 8.6%) |
1.44 |
data-client: list-detail-switch-10 |
16.23 ops/s (± 10.1%) |
20.86 ops/s (± 10.3%) |
1.29 |
data-client: update-user-10000 |
83.68 ops/s (± 8.3%) |
111.12 ops/s (± 17.4%) |
1.33 |
data-client: invalidate-and-resolve |
50.63 ops/s (± 4.7%) |
59.53 ops/s (± 6.0%) |
1.18 |
data-client: unshift-item |
285.71 ops/s (± 1.6%) |
339.08 ops/s (± 5.4%) |
1.19 |
data-client: delete-item |
370.37 ops/s (± 8.9%) |
540.94 ops/s (± 12.5%) |
1.46 |
data-client: move-item |
212.77 ops/s (± 5.7%) |
270.27 ops/s (± 6.1%) |
1.27 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Benchmark
Details
| Benchmark suite | Current: 6d12492 | Previous: dc61f24 | Ratio |
|---|---|---|---|
normalizeLong |
429 ops/sec (±4.19%) |
435 ops/sec (±3.14%) |
1.01 |
normalizeLong Values |
389 ops/sec (±1.18%) |
399 ops/sec (±0.37%) |
1.03 |
normalizeLong Scalar |
371 ops/sec (±3.12%) |
360 ops/sec (±3.60%) |
0.97 |
normalizeLong Scalar update |
933 ops/sec (±0.25%) |
917 ops/sec (±0.51%) |
0.98 |
denormalizeLong |
246 ops/sec (±6.21%) |
240 ops/sec (±6.45%) |
0.98 |
denormalizeLong Values |
230 ops/sec (±4.76%) |
229 ops/sec (±3.92%) |
1.00 |
denormalizeLong donotcache |
985 ops/sec (±0.97%) |
1001 ops/sec (±1.05%) |
1.02 |
denormalizeLong Values donotcache |
742 ops/sec (±0.15%) |
759 ops/sec (±0.19%) |
1.02 |
denormalizeLong Scalar donotcache |
1071 ops/sec (±0.25%) |
1032 ops/sec (±0.42%) |
0.96 |
denormalizeShort donotcache 500x |
1424 ops/sec (±1.17%) |
1425 ops/sec (±0.09%) |
1.00 |
denormalizeShort 500x |
659 ops/sec (±6.89%) |
652 ops/sec (±7.40%) |
0.99 |
denormalizeShort 500x withCache |
6708 ops/sec (±0.32%) |
6956 ops/sec (±0.19%) |
1.04 |
queryShort 500x withCache |
3259 ops/sec (±3.51%) |
3197 ops/sec (±0.20%) |
0.98 |
buildQueryKey All |
60489 ops/sec (±1.12%) |
60550 ops/sec (±0.52%) |
1.00 |
query All withCache |
6384 ops/sec (±2.56%) |
6317 ops/sec (±2.28%) |
0.99 |
denormalizeLong with mixin Entity |
222 ops/sec (±7.50%) |
212 ops/sec (±7.25%) |
0.95 |
denormalizeLong withCache |
6748 ops/sec (±0.20%) |
6234 ops/sec (±0.26%) |
0.92 |
denormalizeLong withCache (Scalar churn) |
6714 ops/sec (±0.88%) |
6166 ops/sec (±0.97%) |
0.92 |
denormalizeLong Values withCache |
5313 ops/sec (±2.04%) |
5263 ops/sec (±1.23%) |
0.99 |
denormalizeLong Scalar withCache |
7867 ops/sec (±0.22%) |
7781 ops/sec (±0.99%) |
0.99 |
denormalizeLong Scalar update withCache |
4108 ops/sec (±0.23%) |
4086 ops/sec (±0.31%) |
0.99 |
denormalizeLong All withCache |
6537 ops/sec (±0.31%) |
6476 ops/sec (±0.31%) |
0.99 |
denormalizeLong Query-sorted withCache |
6687 ops/sec (±1.71%) |
6562 ops/sec (±1.90%) |
0.98 |
denormalizeLongAndShort withEntityCacheOnly |
1699 ops/sec (±0.16%) |
1694 ops/sec (±0.25%) |
1.00 |
denormalize bidirectional 50 |
4648 ops/sec (±10.15%) |
4657 ops/sec (±9.10%) |
1.00 |
denormalize bidirectional 50 donotcache |
43228 ops/sec (±0.22%) |
43131 ops/sec (±0.26%) |
1.00 |
getResponse |
4434 ops/sec (±4.41%) |
4576 ops/sec (±3.99%) |
1.03 |
getResponse (null) |
10182786 ops/sec (±0.81%) |
10377281 ops/sec (±0.42%) |
1.02 |
getResponse (clear cache) |
209 ops/sec (±6.67%) |
207 ops/sec (±7.99%) |
0.99 |
getSmallResponse |
3540 ops/sec (±0.24%) |
3574 ops/sec (±1.08%) |
1.01 |
getSmallInferredResponse |
2865 ops/sec (±0.21%) |
2886 ops/sec (±0.19%) |
1.01 |
getResponse Collection |
4219 ops/sec (±4.24%) |
4408 ops/sec (±4.11%) |
1.04 |
get Collection |
2707 ops/sec (±0.21%) |
2687 ops/sec (±0.21%) |
0.99 |
get Query-sorted |
5034 ops/sec (±1.43%) |
5045 ops/sec (±1.71%) |
1.00 |
setLong |
424 ops/sec (±0.24%) |
442 ops/sec (±0.17%) |
1.04 |
setLongWithMerge |
245 ops/sec (±0.99%) |
249 ops/sec (±0.64%) |
1.02 |
setLongWithSimpleMerge |
264 ops/sec (±0.20%) |
269 ops/sec (±0.64%) |
1.02 |
setSmallResponse 500x |
921 ops/sec (±1.75%) |
905 ops/sec (±1.63%) |
0.98 |
setMany 50x one-per-row |
156 ops/sec (±0.33%) |
150 ops/sec (±0.83%) |
0.96 |
setMany 50 batch |
3631 ops/sec (±2.72%) |
3553 ops/sec (±0.54%) |
0.98 |
setMany 500x one-per-row |
16.1 ops/sec (±0.41%) |
15.13 ops/sec (±0.39%) |
0.94 |
setMany 500 batch |
1407 ops/sec (±1.75%) |
1429 ops/sec (±0.26%) |
1.02 |
This comment was automatically generated by workflow using github-action-benchmark.
Requested by Nathaniel · project thread
Follow-up to #4414, from Codex's review findings there.
Motivation
Before:
Fixtureand the other fixture types in@data-client/core/mock(re-exported by@data-client/react/mockand@data-client/test) importedEndpointInterface/ResolveTypefrom@data-client/endpoint, whichcore,reactandtestdon't depend on. A project with only@data-client/reactand@data-client/testinstalled (e.g. pnpm strict) getsCannot find module '@data-client/endpoint'when type-checking. Separately, #4414 set@data-client/test's react peer floor to^0.15.0, but@data-client/react0.15.0–0.15.2 export./mockwithout arequirecondition, so Jest/CommonJS tests fail to load it.After: core's fixture types import those types from core itself, and the peer floor is
^0.15.3. The v0.19 changeset and migration guide now say 0.15.3.Solution
packages/core/src/mock/fixtureTypes.tsimports from'../index.js', the same types the deleted@data-client/testcopy got via@data-client/react.@data-client/testpeer@data-client/react:^0.15.3 || ^0.16.0 || ^0.17.0 || ^0.18.0(checked on npm:require: ./dist/mock.jsfirst appears in 0.15.3).Changeset:
Verified:
yarn ci:build:types(no@data-client/endpointimport left incore/lib/mock), core-mock and react tests (460 passed),yarn check:doc-examples react(277 pass),yarn copy:websitetypes.Generated by Claude Code
Note
Low Risk
Type-only import path change plus a narrower test peer range; runtime behavior is unchanged, but projects on @data-client/react 0.15.0–0.15.2 must upgrade when bumping @data-client/test.
Overview
Fixture types (
Fixture,Interceptor, etc.) in@data-client/core/mock(and re-exports from@data-client/react/mockand@data-client/test) now importEndpointInterfaceandResolveTypefrom@data-client/normalizrinstead of@data-client/endpoint, so type-checking no longer requires a package those libraries do not depend on (e.g. pnpm strict installs of only react + test).@data-client/testtightens its@data-client/reactpeer to^0.15.3, dropping 0.15.0–0.15.2 because./mockonly gets a workingrequireentry in 0.15.3 for Jest/CommonJS. Changesets, the v0.19 migration blog, and agent metadata reflect 0.15.3 instead of 0.15.The website Playground
@data-client/core/mock.d.tsstub is regenerated (duplicate type blocks removed; naming aligned with core).Reviewed by Cursor Bugbot for commit 6d12492. Bugbot is set up for automated code reviews on this repo. Configure here.