You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if you spawn an isolate in the standalone VM given a URL to a Dart library with no main(), you get:
in ShutdownIsolate: Unable to resolve function 'main' in library 'file:///.../plugin.dart'.
And the app terminates.
For plug-ins, the typical pattern is to load code dynamically and then use reflection/mirrors to determine what to invoke instead of relying on a fixed entrypoint. To get around this in the dev server, we currently procedurally create a temporary Dart script that has a no-op main() method and imports the real library. Then we save that to a temp directory and use that URL to spawn the isolate. That's obviously pretty gross.
Currently, if you spawn an isolate in the standalone VM given a URL to a Dart library with no main(), you get:
in ShutdownIsolate: Unable to resolve function 'main' in library 'file:///.../plugin.dart'.
And the app terminates.
For plug-ins, the typical pattern is to load code dynamically and then use reflection/mirrors to determine what to invoke instead of relying on a fixed entrypoint. To get around this in the dev server, we currently procedurally create a temporary Dart script that has a no-op main() method and imports the real library. Then we save that to a temp directory and use that URL to spawn the isolate. That's obviously pretty gross.
Instead, I'm thinking something like:
SendPort spawnIsolate(String url, {bool invokeMain: true});
If invokeMain is false, it just loads the isolate without calling main() (whether or not it's there).
Note that I only need this to work in the standalone VM, so my need isn't gated on dart2js or Dartium support for it.
The text was updated successfully, but these errors were encountered: