effect icon indicating copy to clipboard operation
effect copied to clipboard

Fixes to support building under TypeScript 5.9

Open rbuckton opened this issue 7 months ago • 3 comments

Type

  • [ ] Refactor
  • [ ] Feature
  • [x] Bug Fix
  • [ ] Optimization
  • [ ] Documentation Update

Description

This fixes compile-time errors discovered when running tests for updated DOM types in TypeScript 5.9. This also addresses compile-time errors resulting from a change in TypeScript 5.8 where the global ArrayBuffer type is now distinct from SharedArrayBuffer and various typed arrays.

The changes herein are primarily internal casts to a more concrete type. Avoiding the casts would require more extensive changes to effect that I would rather leave up to the maintainers. The only non-cast change is to address a bug in HttpIncomingMessage which declares an arrayBuffer property that returns an effect for ArrayBuffer, but was actually returning an effect for a Uint8Array.

Some of the underlying errors can be seen by upgrading the version of typescript in the repository's package.json. Errors related to invalid casts to an IDBValidKey require the updated DOM types from https://github.com/microsoft/TypeScript/pull/61647.

Related

https://github.com/microsoft/TypeScript/pull/61647#issuecomment-2852617744

rbuckton avatar May 07 '25 16:05 rbuckton

🦋 Changeset detected

Latest commit: d427dcc2aafec54d2a2236895bdccd0e719ad70e

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

This PR includes changesets to release 32 packages
Name Type
@effect/platform-browser Patch
@effect/platform-node Patch
@effect/experimental Patch
effect Patch
@effect/cli Patch
@effect/cluster Patch
@effect/sql-clickhouse Patch
@effect/sql-drizzle Patch
@effect/sql-mssql Patch
@effect/sql-sqlite-node Patch
@effect/ai-anthropic Patch
@effect/ai-openai Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/sql Patch
@effect/ai Patch
@effect/opentelemetry Patch
@effect/platform-bun Patch
@effect/platform-node-shared Patch
@effect/platform Patch
@effect/printer-ansi Patch
@effect/printer Patch
@effect/rpc Patch
@effect/sql-kysely Patch
@effect/typeclass Patch
@effect/vitest 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

changeset-bot[bot] avatar May 07 '25 16:05 changeset-bot[bot]

Type

  • [ ] Refactor
  • [ ] Feature
  • [x] Bug Fix
  • [ ] Optimization
  • [ ] Documentation Update

Description

This fixes compile-time errors discovered when running tests for updated DOM types in TypeScript 5.9. This also addresses compile-time errors resulting from a change in TypeScript 5.8 where the global ArrayBuffer type is now distinct from SharedArrayBuffer and various typed arrays.

The changes herein are primarily internal casts to a more concrete type. Avoiding the casts would require more extensive changes to effect that I would rather leave up to the maintainers. The only non-cast change is to address a bug in HttpIncomingMessage which declares an arrayBuffer property that returns an effect for ArrayBuffer, but was actually returning an effect for a Uint8Array.

Some of the underlying errors can be seen by upgrading the version of typescript in the repository's package.json. Errors related to invalid casts to an IDBValidKey require the updated DOM types from microsoft/TypeScript#61647.

Related

microsoft/TypeScript#61647 (comment)

Thanks for the PR!

mikearnaldi avatar May 08 '25 08:05 mikearnaldi

I am running into this issue regarding HttpIncomingMessage

sambacha avatar Jun 12 '25 10:06 sambacha