jupyterlab / lumino

Lumino is a library for building interactive web applications
https://lumino.readthedocs.io/
Other
635 stars 126 forks source link

Deprecation in 1.x without fix #559

Closed vidartf closed 1 year ago

vidartf commented 1 year ago

Description

Using the latest 1.x release, I'm encountering a depreciation warning that IDragEvent is deprecated and will be removed in 2.x in favor of Drag.Event. I think "oh, thanks for the warning, I will change that immediately", and change the code to use Drag.Event, but now get told that it doesn't exist. So I'm left to wonder what the purpose of the depreciation warning was 😅

Reproduce

  1. Import IDragEvent in an editor that gives hints. It will still compile, but your IDE will give you a warning.

Expected behavior

The "in favor of" solution should exist in the 1.x branch, or the warning should be removed.

Context

Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here, if applicable.

afshin commented 1 year ago

The interface IDragEvent also exists in Lumino 2. along with the deprecation tag.

https://github.com/jupyterlab/lumino/blob/133d8725f4dd2c3a56b10d917f1a7b116ff17ce8/packages/dragdrop/src/index.ts#L14-L20

So maybe the right answer is to remove the deprecation tag in Lumino 1, as in your alternate suggestion, and allow people to change their code once they upgrade to Lumino 2.

vidartf commented 1 year ago

Yes, that's probably the best solution. I know in Python it is possible to differentiate between "this will be deprecated in the future" and "this is currently deprecated ", but I don't think jsdoc tags support that distinction?