Skip to content

Fix published pre-response handler types#6433

Draft
coyaSONG wants to merge 1 commit into
Effect-TS:mainfrom
coyaSONG:agent/fix-published-pre-response-handler-types
Draft

Fix published pre-response handler types#6433
coyaSONG wants to merge 1 commit into
Effect-TS:mainfrom
coyaSONG:agent/fix-published-pre-response-handler-types

Conversation

@coyaSONG

@coyaSONG coyaSONG commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Preserve appendPreResponseHandlerUnsafe in release declaration output. HttpEffect publicly re-exports this function, but its implementation declaration was tagged @internal. Release builds enable stripInternal, so the symbol disappeared from internal/preResponseHandler.d.ts while HttpEffect.d.ts still 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 @internal symbols, adds regression coverage, and includes a patch changeset.

Validation:

  • pnpm lint-fix
  • pnpm --dir packages/tools/oxc test --run (51 tests)
  • pnpm vitest run packages/effect/test/unstable/http/HttpEffect.test.ts (17 tests)
  • pnpm check
  • release-style declaration emit with --stripInternal true (the internal file now declares appendPreResponseHandlerUnsafe instead of emitting export {})

Prepared with OpenAI Codex assistance; repository guidance, scope, diff, and validation results were checked before publication.

Related

@github-project-automation github-project-automation Bot moved this to Discussion Ongoing in PR Backlog Jul 16, 2026
@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7909a17

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

This PR includes changesets to release 27 packages
Name Type
effect Patch
@effect/opentelemetry Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/openapi-generator 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

@IMax153 IMax153 added the 4.0 label Jul 16, 2026
@IMax153
IMax153 requested a review from gcanti July 16, 2026 21:39
@gcanti gcanti assigned tim-smart and unassigned gcanti Jul 17, 2026
@gcanti
gcanti requested review from tim-smart and removed request for gcanti July 17, 2026 07:35
/** @internal */
export const requestPreResponseHandlers = new WeakMap<object, PreResponseHandler>()

/** @internal */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not remove internal annotations from exports in the internal folder, we should instead annotate with the type the public re-export

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Discussion Ongoing

Development

Successfully merging this pull request may close these issues.

effect@4.0.0-beta.98 publishes empty preResponseHandler.d.ts used by HttpEffect

5 participants