Fix published pre-response handler types - #6433
Conversation
🦋 Changeset detectedLatest commit: 9fab402 The changes in this PR will be included in the next version bump. This PR includes changesets to release 27 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 |
| /** @internal */ | ||
| export const requestPreResponseHandlers = new WeakMap<object, PreResponseHandler>() | ||
|
|
||
| /** @internal */ |
There was a problem hiding this comment.
we should not remove internal annotations from exports in the internal folder, we should instead annotate with the type the public re-export
✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR updates HTTP pre-response handler exports to produce a usable declaration and extends ChangesHTTP declaration fix
Internal export analysis
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant PublicModule
participant no_unused_internal
participant workspacePackages
participant Diagnostic
PublicModule->>no_unused_internal: provide named export declaration
no_unused_internal->>workspacePackages: resolve re-exported source
workspacePackages-->>no_unused_internal: return internal export matches
no_unused_internal->>Diagnostic: report internal public re-export
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/tools/oxc/test/no-unused-internal.test.ts (1)
89-104: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover direct
export … fromre-exports.This fixture only exercises the imported-binding path. Add
export { internal } from "./Internal.ts"to cover the newmoduleSpecifierresolution branch.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/tools/oxc/test/no-unused-internal.test.ts` around lines 89 - 104, Extend the test case in “reports public re-exports of `@internal` exports” to use a direct export-from declaration, `export { internal } from "./Internal.ts"`, so the moduleSpecifier resolution branch is exercised while preserving the expected diagnostic and clean Internal.ts result.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/tools/oxc/test/no-unused-internal.test.ts`:
- Around line 89-104: Extend the test case in “reports public re-exports of
`@internal` exports” to use a direct export-from declaration, `export { internal }
from "./Internal.ts"`, so the moduleSpecifier resolution branch is exercised
while preserving the expected diagnostic and clean Internal.ts result.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: c50c0d24-7156-48eb-a81b-8a8f7d65707f
📒 Files selected for processing (4)
.changeset/fix-http-pre-response-handler-types.mdpackages/effect/src/unstable/http/internal/preResponseHandler.tspackages/tools/oxc/src/oxlint/rules/no-unused-internal.tspackages/tools/oxc/test/no-unused-internal.test.ts
💤 Files with no reviewable changes (1)
- packages/effect/src/unstable/http/internal/preResponseHandler.ts
df1fb03 to
a54b841
Compare
Bundle Size Analysis
|
Type
Description
Preserve
appendPreResponseHandlerUnsafein release declaration output.HttpEffectpublicly re-exports this function, but its implementation declaration was tagged@internal. Release builds enablestripInternal, so the symbol disappeared frominternal/preResponseHandler.d.tswhileHttpEffect.d.tsstill imported and re-exported it. Consumers using strict library checking then received TS2305.This change removes the erroneous internal marker, extends the existing lint rule to flag public named re-exports of
@internalsymbols, adds regression coverage, and includes a patch changeset.Validation:
pnpm lint-fixpnpm --dir packages/tools/oxc test --run(51 tests)pnpm vitest run packages/effect/test/unstable/http/HttpEffect.test.ts(17 tests)pnpm check--stripInternal true(the internal file now declaresappendPreResponseHandlerUnsafeinstead of emittingexport {})Prepared with OpenAI Codex assistance; repository guidance, scope, diff, and validation results were checked before publication.
Related
Summary by CodeRabbit
Bug Fixes
Developer Experience
Tests