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

Typing of @lumino/widgets changed from 1.19 to 1.20 #170

Closed
fcollonval opened this issue Apr 17, 2021 · 3 comments · Fixed by #172 or #175
Closed

Typing of @lumino/widgets changed from 1.19 to 1.20 #170

fcollonval opened this issue Apr 17, 2021 · 3 comments · Fixed by #172 or #175
Labels
bug Something isn't working

Comments

@fcollonval
Copy link
Member

Description

The trouble comes from a change in the type file generated by the lumino package. In 1.19.0, the Widget.layout accessor was translated as property in the type declaration. But now in 1.20.0, the accessor is kept:

image

This coupled with the new constrain (Properties Overriding Accessors (and vice versa) is an Error) on Typescript v4 will break code. The error is now seen on JupyterLab yet as the lock file is pulling version 1.19.0 of @lumino/widgets.

Expected behavior

The type between minor version does not change.

Xref: jupyterlab/jupyterlab#10088

I hit this issue when upgrading the lock file on @jupyterlab/git: https://github.com/jupyterlab/jupyterlab-git/pull/926/checks?check_run_id=2359801487

@fcollonval fcollonval added the bug Something isn't working label Apr 17, 2021
@fcollonval
Copy link
Member Author

Unfortunately #172 did not correct this and @lumino/widgets@1.21.0 is still defining types as in 1.20.0.

@fcollonval fcollonval reopened this Apr 21, 2021
@fcollonval
Copy link
Member Author

Actually the change in the produced typing file was introduced in TypeScript 3.7: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#the-usedefineforclassfields-flag-and-the-declare-property-modifier

To detect the issue around accessors, TypeScript 3.7 will now emit get/set accessors in .d.ts files so that in TypeScript can check for overridden accessors.

@fcollonval
Copy link
Member Author

So it seems we are stuck with Typescript 3.6, if we want to ensure dependent packages using Typescript 4+ can build without error.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant