-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[breaking change] Remove Object
from ExternalDartReference
's implemented types
#56015
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
Comments
Object?
from ExternalDartReference
's implemented typesObject
from ExternalDartReference
's implemented types
@itsjustkevin I sent out an email to [email protected] for this. Let me know if you need anything else to start the review process. Thanks! |
LGTM! |
Thanks @srujzs. Breaking change LGTM too. cc @mkustermann |
LGTM As the API that's being changed is relatively new with limited users, I'd suggest to use an accelerated process to ensure the breaking change will land before the next stable (to minimize change of more users to start relying on the now-deprecated API) |
@mit-mit @vsmenon The cutoff for next stable seems to be 1st of July. Can we get this approved beforehand to ensure it's included in the next stable? (If we delay this, people may start relying on this API more widely and changing it will cause more trouble for ecosystem, so the sooner we do it the better) |
LGTM |
Please make sure to post on dart-announce |
Thanks, it was posted last week. Usage currently is extremely minimal, so we don't expect to hear much. |
@itsjustkevin Does it need signoff from anyone else or can this be marked as approved and @srujzs can go ahead and land the change? |
FYI @itsjustkevin is OOO this week. We believe he will be back next week. |
Looking at the updated calendar, it seems @itsjustkevin will be OOO until mid week. I reviewed previous breaking change requests and it appears we typically seek approval from representatives in Flutter and ACX as well. @Hixie @leonsenft @vsmenon - could you take a look at this breaking change request? Thank you! |
LGTM 👍 |
no objection from me. cc @yjbanov |
lgtm |
Thanks everyone! Following the protocol, I went ahead and marked this breaking change as approved @itsjustkevin - when you are back, is there anything else do to for this issue or is it OK to close it now? @srujzs - we should be OK to move forward now ahead of the upcoming cutoff next week |
Change Intent
dart:js_interop
'sExternalDartReference
allows users to pass opaque references to Dart objects such that they can be passed through JavaScript back to Dart efficiently. The library provides two extension methods:toExternalReference
andtoDartObject
to convert to and from the opaque reference.ExternalDartReference
will now instead be generic andtoExternalReference
will return a reference to anyT
, includingnull
. Therefore, the extension type can longer implementObject
, as the representation type will be nullable.Justification
ExternalDartReference
should be generic to avoid extra downcasts when compiling to JS, and to be able to represent what type of Dart object the reference refers to.On top of this, we should include
null
values i.e.T extends Object?
instead ofT extends Object
, so that other generic interfaces e.g.Finalizer
that have an unboundedT
do not have to include extra null-checks to be able to convert to and from anExternalDartReference
.Original issues: #55536, #55342
Impact
Low. There is low usage in two repos:
FinalizationRegistry
. 0 1 2 3svelte_js.dart
. The owner is the same user who originally filed the request.Mitigation
Any assignment of
ExternalDartReference
toObject
can instead be made an assignment toObject?
. For example:Change Timeline
The implementation is already done (see below). Ideally, this should go in beta 2 so that we don't have to wait for the next stable to submit this as breaking changes can't be submitted in the last beta.
Associated CLs
https://dart-review.googlesource.com/c/sdk/+/370663
The text was updated successfully, but these errors were encountered: