-
Notifications
You must be signed in to change notification settings - Fork 946
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
Update to TypeScript 4.3 #3162
Update to TypeScript 4.3 #3162
Conversation
One of the changes introduced in TypeScript Error: src/widget.ts(187,14): error TS2790: The operand of a 'delete' operator must be optional.
Error: src/widget.ts(193,12): error TS2790: The operand of a 'delete' operator must be optional.
Error: src/widget.ts(760,12): error TS2790: The operand of a 'delete' operator must be optional.
Error: src/widget.ts(798,12): error TS2790: The operand of a 'delete' operator must be optional. Which corresponds to: ipywidgets/packages/base/src/widget.ts Line 187 in f085739
|
Adding to the 8.0 milestone for consideration as this might result in changes in public interfaces and typings. |
Another change is related to properties overriding accessors (TS2610) in 4.0: For example:
Link to a TypeScript playground for reference: |
One convention changed here is that a widget’s _view is now always a DOMWidgetView, and disposal invalidates the typing contract (rather than having to always special-case the disposal case of a null _view).
We had to upgrade backbone to get the new preinitialize method, so we can properly initialize the tagName.
I updated to TS 4.3 and fixed the errors. |
@jtpio: your commits look good. Can you review my commits, and merge if they look good? |
(or @vidartf or anyone else, feel free to review all of our commits and merge if they look good :) |
Thanks Jason for picking this up! |
@@ -29,7 +29,7 @@ | |||
"@jupyterlab/services": "^6.0.0", | |||
"@lumino/messaging": "^1.3.3", | |||
"@lumino/widgets": "^1.11.1", | |||
"backbone": "1.2.3" | |||
"backbone": "1.4.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to double check: this backbone
update was required to grab the new preinitialize
method? (and then fix the TS error)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes looks like it's mentioned in the change log on https://backbonejs.org:
Just checked the diff, quickly tried on Binder and it looks good 👍 Thanks! Leaving it open one more day in case someone else also wants to have a look, and then we should be able to merge it. |
Thanks! |
Update the
typescript
dependency to the latest version.Leaving as a draft for now as there might be some breaking changes to fix.