I have successfully used isolates in dart and js from the same source code.
It works fine, the only limitation is that you have to have your url for worker in web dir because once built the urls for lib change, other than that it works as expected, use the same URL (for example 'worker.dart') and it is compiled to a separate js executable. I have not tried to call the worker unit from JS from main thread, I am not sure it this will work, but calling it from dart from main thread works.
Here is an example:
/// Initializes the worker (url is passes static - worker.dart).
Future _initWorker() async {
var uri = Uri.parse(url);
_worker = await Isolate.spawnUri(uri, [], _reciever.sendPort);
_reciever.listen(_handleData);
return null;
}
Interestingly the dart file for worker is not requested, instead the js file is fetched: