Skip to content
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

TypeScript 5.5 compatibility for ObservableSet #3890

Closed
SimenB opened this issue Jun 24, 2024 · 2 comments
Closed

TypeScript 5.5 compatibility for ObservableSet #3890

SimenB opened this issue Jun 24, 2024 · 2 comments
Labels

Comments

@SimenB
Copy link

SimenB commented Jun 24, 2024

Intended outcome:

MobX's ObservableSet should implement all Set methods.

https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/#support-for-new-ecmascript-set-methods

Actual outcome:

It doesn't, leading to

node_modules/mobx/dist/types/observableset.d.ts:25:22 - error TS2420: Class 'ObservableSet<T>' incorrectly implements interface 'Set<T>'.
  Type 'ObservableSet<T>' is missing the following properties from type 'Set<T>': union, intersection, difference, symmetricDifference, and 3 more.

25 export declare class ObservableSet<T = any> implements Set<T>, IInterceptable<ISetWillChange>, IListenable {

How to reproduce the issue:

https://www.typescriptlang.org/play/?target=99&ts=5.5.2#code/JYWwDg9gTgLgBAbzgeQEYGcCmUBuBDVAG0wGVN4BfOAMyghDgHIQJUAPRgbgChuBjCADt08FuzIwAXHAkAeAK6CA1oIgB3QQD44AXjiDMalBmz4ipcgAoAlDyA

Changing TS versions to 5.4.5 resolves the type error.

Playground doesn't have skipLibCheck: false, otherwise the implements within the MobX type would fail rather than the satisfies.

Versions

mobx@6.12.3

@kubk
Copy link
Collaborator

kubk commented Jun 25, 2024

Should be fixed by #3853

@SimenB
Copy link
Author

SimenB commented Jul 1, 2024

Duplicate of #3850

@SimenB SimenB closed this as not planned Won't fix, can't repro, duplicate, stale Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants