sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Track: Remove deprecated core library APIs

Open nuritzi opened this issue 3 years ago • 4 comments

Goal: We'd like to track progress on removing core library APIs that have earlier been deprecated. This will help us track progress towards our next Dart major version.

Frequency: we'd like to pull these stats on a weekly basis.

How to

You may be able to get this information by # search hits for "@deprecated" in sdk/lib/

Todos

  • [ ] Measure: Number of deprecations left to remove.
  • [x] Document how you pulled this information (can be in a doc or in this issue).
  • [ ] Automate a weekly report if possible.

nuritzi avatar Aug 29 '22 10:08 nuritzi

@itsjustkevin -- it looks like I don't have the ability to assign issues to people. Are you able to do so? this issue is meant for you to help with after the upcoming release.

nuritzi avatar Aug 29 '22 10:08 nuritzi

I self-assigned.

itsjustkevin avatar Aug 30 '22 14:08 itsjustkevin

@sigmundch I ran a git grep --count '@deprecated' over the sdk/lib directory and found that a lot of the @deprecated annotations are in dart2js.

My question is, what work do we need to do to remove these deprecations?

grep output

_internal/js_dev_runtime/patch/core_patch.dart:2
_internal/js_dev_runtime/private/isolate_helper.dart:1
_internal/js_runtime/lib/core_patch.dart:2
_internal/vm/lib/double_patch.dart:1
_internal/wasm/lib/double.dart:1
core/annotations.dart:3
core/double.dart:1
core/int.dart:1
core/num.dart:1
html/dart2js/html_dart2js.dart:33
io/security_context.dart:1
web_sql/dart2js/web_sql_dart2js.dart:2

itsjustkevin avatar Sep 08 '22 16:09 itsjustkevin

_internal/js_dev_runtime/patch/core_patch.dart:2
_internal/js_dev_runtime/private/isolate_helper.dart:1
_internal/js_runtime/lib/core_patch.dart:2
_internal/vm/lib/double_patch.dart:1
_internal/wasm/lib/double.dart:1
core/annotations.dart:3
core/double.dart:1
core/int.dart:1
core/num.dart:1
html/dart2js/html_dart2js.dart:33
io/security_context.dart:1
web_sql/dart2js/web_sql_dart2js.dart:2

itsjustkevin avatar Sep 13 '22 14:09 itsjustkevin

@itsjustkevin - I know you are still circling back on the precise goals here, but some quick insights into the list you shared:

  • num.parse has a deprecated onError parameter, this deprecation is behind all the annotations in this list:
_internal/js_dev_runtime/patch/core_patch.dart:2
_internal/js_dev_runtime/private/isolate_helper.dart:1
_internal/js_runtime/lib/core_patch.dart:2
_internal/vm/lib/double_patch.dart:1
_internal/wasm/lib/double.dart:1
core/double.dart:1
core/int.dart:1
core/num.dart:1
  • deprecations on annotations and in dart:io are their own thing, but I'm not familiar with the plan here:
core/annotations.dart:3
io/security_context.dart:1
  • Finally we have the dart:html deprecations:
html/dart2js/html_dart2js.dart:33
web_sql/dart2js/web_sql_dart2js.dart:2

The web_sql library was practically removed for external developers since 2.15. The file exists, but we can ignore it. That's because it is not built into our sdk .dill files and it's not possible to import it (so we made this breaking change already at commit 38b5a841). The reason the file still exists is because cleaning it up is more work than it was worth at the moment.

Finally, as we briefly mentioned on the scrum the other day, the dart:html library is special. Given our plans to put together a new package that will eventually replace this library, we are less inclined to delete the deprecated APIs at this time. It's possible however that we will delete the few APIs related to this breaking change: https://github.com/dart-lang/sdk/issues/49536

sigmundch avatar Sep 23 '22 16:09 sigmundch

I'm currently tracking this in https://github.com/dart-lang/sdk/issues/49529

mit-mit avatar Oct 10 '22 17:10 mit-mit