fix(deps): widen @mittwald/react-use-promise peer range to 3.x and 4.x - #294
Open
mfal wants to merge 2 commits into
Open
fix(deps): widen @mittwald/react-use-promise peer range to 3.x and 4.x#294mfal wants to merge 2 commits into
mfal wants to merge 2 commits into
Conversation
The published peer range `^2.6.0` could not be satisfied alongside the current `@mittwald/react-use-promise` release (4.2.2), so any project combining these packages with `@mittwald/flow-react-components` (which requires `^4.2.2`) saw a non-overlapping-range warning on install. The range was never widened rather than deliberately held: every symbol used here is unchanged or only widened between 2.6 and 4.2.2, and the React-19-only peer that 3.0.0 and 4.0.0 declared was walked back to `react >=18.3` in 3.0.4 and 4.0.2. The devDependency moves to `~4.0.2` rather than `^4.0.2`: from 4.1.0 on, the shipped `.d.ts` files use extensionless relative imports while the package is `"type": "module"`, which does not resolve under this repo's `moduleResolution: NodeNext` and collapses the export surface. That is a types-only packaging regression upstream; once it is fixed the devDependency can move to `^4.2.x` with no change to the peer range. Refs #293 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
4.2.3 restores the `.js` extensions in the shipped `.d.ts` files, so the TS2305 collapse of the export surface under `moduleResolution: NodeNext` that pinned this repo to `~4.0.2` is gone. CI now exercises the same latest 4.x that consumers resolve. The peer range is unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the disjoint peer range reported in #293.
@mittwald/api-models,@mittwald/api-client-commonsand@mittwald/api-clientdeclared"@mittwald/react-use-promise": "^2.6.0", which has no intersection with the^4.2.2that@mittwald/flow-react-componentsrequires. Since the peer isoptional: truethis was a warning rather than a failure, but every consumer of both libraries saw it.Changes
peerDependencies(all 3 packages)^2.6.0^2.6.0 || ^3.0.0 || ^4.0.0devDependencies(all 3 packages)^2.6.2^4.2.3The range was never widened, not deliberately held
Every symbol this repo uses is unchanged or only widened between 2.6 and 4.2.3:
getAsyncResource(fn, params, { tags, loaderId })— identical signature (the parameter type was renamedAsyncFn→LoaderFnin 4.0, but structurally widened: it now also accepts sync loaders)refresh({ tag })—Tagwidened fromstringtostring | [string, string]; a plainstringstill fitsStore<T>from/storewithget/set/getAll;StorageEntryOptions.tagsstill acceptsstring[]usePromise(..., { useSuspense: false })→.hasValue— unchangedAsyncResource<T>,asyncResourceStore— present throughoutThe React-19 peer that made 3.0.0 and 4.0.0 look like hard breaks was walked back in a patch each time:
peerDependencies.react>=17.0>=19.0>=18.3>=19.0>=18.3So the widened range forces React 19 on nobody.
The devDependency tracks latest again (was briefly held at
~4.0.2)This PR originally pinned the devDependency to
~4.0.2, because 4.1.0 through 4.2.2 reddened this repo's build. 4.2.3 fixes that, so the devDependency now moves to^4.2.3and CI exercises the same latest 4.x that consumers resolve.The defect, for the record: from 4.1.0 on, the shipped
.d.tsfiles used extensionless relative imports while the package is"type": "module":Under this repo's
moduleResolution: NodeNextthose paths did not resolve and the whole export surface collapsed:It was always types-only —
dist/esm/index.jskept its.jsextensions throughout — which is why the peer range admitted^4.0.0in full even while the devDependency was held back. Verified against the 4.2.3 tarball: no extensionless relative import remains anywhere indist/types/**/*.d.ts.Measured per version — pin as devDependency in all three packages,
yarn install, thennx run-many -t build(tsc per package) and the Jest suites:buildKnown side effect
client-react.tsdoesexport * from "@mittwald/react-use-promise", so the type exports removed in 3.x/4.x —AsyncFn,AsyncLoader,TagPattern, and the deprecatedAsyncResource.watch()— also disappear from what@mittwald/api-clientre-exports for consumers who resolve a 3.x/4.x peer. Nothing in this repo uses them.Verification
build,lintandtestall green against 4.2.3, each with--skip-nx-cache:nx run-many -t build— 4/4 projects, no TS2305nx run-many -t lint— 4/4 projectsnx run-many -t test— 45 tests across the three packages (23 code-generator, 17 commons, 5 models), includingApiCallAsyncResourceFactory.test.tsandprovideReact.test.tsx, which are the ones exercising the hooksyarn explain peer-requirementsreports no unmet peer for@mittwald/react-use-promise— theyarn installwarning is gone. The one remaining unmet peer,@typescript-eslint/utils→typescript, pre-dates this branch and is untouched by it.🤖 Generated with Claude Code