Skip to content

fix: auth typings and reduced type ambiguity#4562

Merged
Marsup merged 2 commits intohapijs:masterfrom
damusix:fix/auth-types-2
Feb 18, 2026
Merged

fix: auth typings and reduced type ambiguity#4562
Marsup merged 2 commits intohapijs:masterfrom
damusix:fix/auth-types-2

Conversation

@damusix
Copy link
Contributor

@damusix damusix commented Feb 13, 2026

@Marsup Marsup added this to the 21.4.5 milestone Feb 18, 2026
@Marsup Marsup self-assigned this Feb 18, 2026
@Marsup Marsup added the types TypeScript type definitions label Feb 18, 2026
@Marsup Marsup merged commit 0ead0ec into hapijs:master Feb 18, 2026
10 checks passed
@fjeldstad
Copy link

This should have been part of a major version bump as the type changes are breaking in some scenarios. For example when extracting a header value; that used to be string | undefined while now it is string | string[] | undefined meaning that it cannot be assigned to a string variable anymore. Even if it is more correct now, I don't think consumers expect the build to break from installing a patch version bump.

@Marsup
Copy link
Contributor

Marsup commented Mar 6, 2026

@fjeldstad we already answered that in #4563. Breaking types is inherent to the typesrcipt ecosystem, nobody releases a major version just for types correctness.

@kanongil
Copy link
Contributor

kanongil commented Mar 6, 2026

nobody releases a major version just for types correctness

FYI, some projects do try to do that by eg. adhering to the proposed semver-ts spec. However, even with that, changes in minor releases can cause type compilation issues! As they state (paraphrased):

We propose the rules below, with the caveat that they will not prevent all possible breakage—only the majority of it.

As such, for typescript development, one must expect that any typings update can potentially cause "breakage".

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

Labels

types TypeScript type definitions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants