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

Migrate devtools_app to null safety #3025

Closed
3 tasks done
kenzieschmoll opened this issue May 14, 2021 · 5 comments
Closed
3 tasks done

Migrate devtools_app to null safety #3025

kenzieschmoll opened this issue May 14, 2021 · 5 comments
Assignees
Labels
Milestone

Comments

@kenzieschmoll
Copy link
Member

kenzieschmoll commented May 14, 2021

devtools_testing and devtools_app depend on one another, so they will need to be migrated and published at the same time.

The following packages need to be migrated before devtools_app can be migrated:

@leafpetersen
Copy link

Any plans on this? cc @jacob314

@polina-c polina-c self-assigned this Jan 27, 2022
@polina-c
Copy link
Contributor

polina-c commented Jan 28, 2022

First tasks:

copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Jan 31, 2022
TEST="tested with the added test 'root-dominator-is-null'"

Bug: flutter/devtools#3025
Change-Id: Ifd6f926e3ecd486d383b03e8b81289310a653bb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230882
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Kenzie (Schmoll) Davisson <kenzieschmoll@google.com>
Commit-Queue: Kenzie (Schmoll) Davisson <kenzieschmoll@google.com>
@polina-c
Copy link
Contributor

polina-c commented Feb 4, 2022

Remaining tasks:

@kenzieschmoll kenzieschmoll added this to the M38 milestone Feb 15, 2022
@polina-c
Copy link
Contributor

polina-c commented Mar 4, 2022

The recipe to migrate separate files:

  1. Run 'dart migrate --skip-import-check'
  2. Deselect everything by deselecting roots (upvote the button Deselect All)
  3. Ctrl+F to find the file(s) you want to migrate
  4. Select the file(s) and click "Apply Migration".
  5. Open the package in VSCode or Android Studio and search the files for cases where the tool may be inaccurate. Make corrections and use lint warnings to interactively clean up upstream and downstream code.

What to watch for, to find the tool inaccuracies:

  1. Added types dynamic or num. Most likely you know which specific type should be here instead.
  2. bool? in most cases can become bool with default value.
  3. Type casts (search for as) may mean the tool did not add a generic type parameter. After adding it, the type cast will be linted as unnecessary.
  4. Generic nullables (search for ?> and ?,) in most cases can be non-nullable.
  5. Nullable fields may become late or late final (upvote lint).
  6. Unconditional operation '!' may mean the variable should be non-nullable (upvote lint).
  7. If '!' is applied to a collection, it can be coalesced with empty collection ( ?? []) instead.

@polina-c
Copy link
Contributor

DevTools are sound null safe now.

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

3 participants