-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Report exported member access on @deprecated export #23067
Comments
Removed Priority-Unassigned label. |
I'd really appreciate this as well. |
In the following example:
What element would get the warning? |
Yes, if test's export of matcher were deprecated, the Also, to be clear, test is not actually planning to deprecate its export of matcher. |
I suspect that the intent of putting a |
I can see both intentions being correct in different cases. If the library is "private" (in lib/src/) then the user will likely not begin using it directly (but may use it indirectly if it's also exported by another public library). In either case, you are in control of the exported library as well, and could potentially make it deprecated. I think the former case is the more likely, and the message could be "the function .. is deprecated as part of ... library. It may be imported as ... library instead.". |
Do the proposals in #32726 make this any easier? Other than the phrasing, are there any other technical blockers to allowing deprecated on an |
You can put
|
This is likely a blocker for #44892 |
Funnily enough deprecating the export of |
(Adding the See also: #48997 |
@scheglov: I'm curious if you've had a chance to think any more about this? |
It looks that we need to track provenance for each exported element - declared in the library, or re-exported from other library (where it might be declared, but might also be re-exported), or re-exported from more than one library, although eventually merging into the same library when the element is declared. So, we need chains of provenance. For this feature we probably would need to look only at the top element of each chain - whether the corresponding Such provenance chains might be useful to know how we get for example |
I'm not opposed to providing more information from the API than we're currently using in server (in fact I think we tend to trim too much from the API), but I'm wondering whether you have a concrete use for this information in mind. |
Theoretically it could be a DAS request that returns such "provenance tree" and IntelliJ could display in a view, something like |
Bug: #23067 Change-Id: I5e2559bed9eafc5bcbf023ccc957f0c46079011c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247462 Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Phil Quitslund <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
Initial: https://dart-review.googlesource.com/c/sdk/+/247604 Revert: https://dart-review.googlesource.com/c/sdk/+/247605 Google3 presubmit looks green: https://fusion2.corp.google.com/presubmit/tap/454521926 Bug: #23067 Change-Id: I9e404e069defdff17beb96555725223184b9adf7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248062 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
Bug: #23067 Change-Id: I6bfe7afabe344bb0de690f762b5f80604809021e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248344 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Johnni Winther <[email protected]> Reviewed-by: Bob Nystrom <[email protected]>
It found a few cases for `BytesBuilder` exported from `dart:io`. I fixed most of them in a separate CL. But package:flutter (itself only) is clean. There are a few violations in google3. I will ignore most of them, and fix a few. Bug: #23067 Change-Id: Ic89370ad84caa60fd49326c2bc60ad5d927e2264 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248343 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Phil Quitslund <[email protected]>
This issue was originally filed by @seaneagan
If you want to stop exporting library A from library B, but you don't want to deprecate library A itself, it would be nice to be able mark the export as deprecated:
@deprecated('Use libraryA.dart directly instead')
export 'libraryA.dart';
Here are some use cases:
Stop exporting something:
dart-lang/test#53
Split part of a library into a separate library with a temporary re-export:
dart-lang/test#2326
The text was updated successfully, but these errors were encountered: