Skip to content

Releases: uhyo/better-typescript-lib

v2.11.0

16 Mar 14:33
Compare
Choose a tag to compare

ℹ️ TypeScript Upgrade Guide

better-typescript-lib 2.11.0 supports TypeScript 5.8.

When you upgrade TypeScript to 5.8 or later, we recommend adding the following setting to your tsconfig.json:

"libReplacement": true

This will be required for better-typescript-lib to work in a future TypeScript version (presumably 6.0).

What's Changed

  • fix: correct return type of document.getElementById from HTMLElement | null to Element | null to account for more general situations like SVGElement by @uhyo in #65
  • Mark Omit as deprecated by @uhyo in #66
  • docs: guide user to enable libReplacement option by @uhyo in #67
  • refactor: refactor aliasing system by @uhyo in #68
  • feat: support TypeScript 5.8 by @uhyo in #69

Full Changelog: v2.10.1...v2.11.0

v2.10.1

14 Jan 14:14
Compare
Choose a tag to compare

What's Changed

  • refactor: remove debugger statement by @uhyo in #55
  • fix: #57 more generic types for Promise.then and Promise.catch by @danielrentz in #60
  • fix: #58 allow to pass function or nullish to JSON.stringify by @danielrentz in #61
  • build:package: fix windows paths in generated package.json by @danielrentz in #62

⚠️ Possible Breaking Change

Calling Promise methods (then and catch) without any parameter is now a type error.

// @ts-expect-error
promise.then();
// @ts-expect-error
promise.catch();

New Contributors

Full Changelog: v2.10.0...v2.10.1

v2.10.0

01 Dec 12:16
Compare
Choose a tag to compare

What's Changed

  • feat: upgrade TypeScript to 5.7 by @uhyo in #54

Full Changelog: v2.9.0...v2.10.0

v2.9.0

23 Sep 13:26
Compare
Choose a tag to compare

What's Changed

  • refactor: split generate function by @uhyo in #49
  • feat: supprort recursively replacing declare global modules by @uhyo in #50
  • feat: upgrade to TS 5.6 by @uhyo in #51

Full Changelog: v2.8.0...v2.9.0

v2.8.0

16 Jul 13:49
Compare
Choose a tag to compare

What's Changed

  • fix: tighten up Object.values and Object.entries types by @uhyo in #42
  • fix: improve NodeListOf<T>#item return type to include null by @uhyo in #44
  • feat: upgrade to TS 5.5 by @uhyo in #45

Full Changelog: v2.7.0...v2.8.0

Breaking Change to Object.entries and Object.values

#42 changed the types of Object.entries and Object.values in a backwards-incompatible way. This had to be done because previous typing was too permissive and unsafe.

The change can be observed in cases like below:

// Previously number[], now unknown[]
const values = Object.values({ foo: 123 });

To recover the previous behavior, you need to give a Record<string, T> type to your object.

const obj: Record<string, number> = { foo: 123 };
// still number[]
const values = Object.values(obj);

Also, we recommend migrating out from Object.values and Object.entries if possible. Map should be a good alternative for many use cases.

See also: #46

v2.7.0

27 Mar 13:43
Compare
Choose a tag to compare

What's Changed

  • feat: improve structuredClone typing by @uhyo in #38
  • chore: upgrade TypeScript to 5.4 by @uhyo in #39

Full Changelog: v2.6.0...v2.7.0

v2.6.0

26 Dec 06:02
Compare
Choose a tag to compare

Full Changelog: v2.5.0...v2.6.0

v2.5.0

18 Sep 11:28
Compare
Choose a tag to compare

Full Changelog: v2.4.0...v2.5.0

  • Upgraded TypeScript to 5.2.

This release suppresses any from new SuppressedError in lib.esnext.disposable.d.ts 🥳

v2.4.0

05 Jun 12:10
Compare
Choose a tag to compare

Full Changelog: v2.3.1...v2.4.0

  • Upgrade TypeScript to 5.1.3

v2.3.1

19 May 15:03
Compare
Choose a tag to compare

Full Changelog: v2.3.0...v2.3.1

What's Changeed

  • Fix type errors when including dom.iterable lib to the project (#30)