Skip to content

Fixes to support building under TypeScript 5.9 #4834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rbuckton
Copy link

@rbuckton rbuckton commented May 7, 2025

Type

  • Refactor
  • Feature
  • 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)

@github-project-automation github-project-automation bot moved this to Discussion Ongoing in PR Backlog May 7, 2025
Copy link

changeset-bot bot commented May 7, 2025

🦋 Changeset detected

Latest commit: d427dcc

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

@mikearnaldi
Copy link
Member

Type

  • Refactor
  • Feature
  • 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Discussion Ongoing
Development

Successfully merging this pull request may close these issues.

3 participants