-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
[web] implement PluginUtilities for flutter web #33615
Comments
@jonahwilliams I think if you added a suggested PluginUtilities List then the developers could vote on it |
Related: #33614 @jonahwilliams @yjbanov Have you given it any thought if these APIs would be implementable on the web? They could help us with restoring anonymous routes. That problem is described in http://flutter.dev/go/restoring-anonymous-routes and For reference, the sub-problem that these APIs are solving for us is the following: Given a static function we need to be able to obtain a serializable identifier for that function. And given that serializable identifier (in another instance of the app) we need to be able to re-obtain the original function object. |
Anything involving isolates is not implementable on the web. |
The API itself is independent of isolates as far as I can tell. |
Depends on what you mean by implement - we could no-op it certainly, but we can't get handles to callbacks that can be shared across isolates. |
Under the assumptions that:
I don't see any reason why it should be impossible to do what @goderbauer is looking for in JS. @sigmundch @rakudrama could possibly provide more accurate commentary. Just because it's possible in principle though doesn't mean that it would just fall out of the current compilation strategy . But I actually think it might not be far off - you could use a class ID plus a static method name maybe? |
Sorry for the very slow response here. Is the expectation that the serialized id is usable within a single version of the app or across multiple versions? I don't see a reason why the former can't be supported, but the latter could be problematic. Many teams consider the names of their methods internal and/or sensitive, so we wouldn't want to use the original class/method name as part of the serialized form. When we minify an application, the minified name would work, but that is not stable across multiple compilations of the program. |
For my use case, the serialized id only has to be usable within a single version of the app. |
/cc @mdebbar This is the missing API we talked about in the meeting the other day. I am using it to restore anonymous Routes (i.e. Routes pushed with push(Route route)). |
This was an email thread between @goderbauer, @sigmundch and I (May 11th 2020):
|
@sigmundch @goderbauer is it possible to use the mobile approach on the web too (take a hash of library, class, and method name)? The lookup table can live in the Dart code as a const map.
Mobile also suffers from collisions. Any idea how they are handling it? Or is mobile just not worried about collisions? |
/cc @bkonyi, who implemented the mobile functionality, if I remember correctly. |
We just don't worry about collisions since the likelihood of there being a collision should be near zero, even if there's a double-digit number of entries. |
@sigmundch is it possible to do the same on web and ignore hash collisions? |
yes that sounds reasonable |
...or don't, maybe it doesn't make sense.
The text was updated successfully, but these errors were encountered: