resource icon indicating copy to clipboard operation
resource copied to clipboard

web support broken

Open rbellens opened this issue 6 years ago • 4 comments

In dart 2.0, dart:isolate is no longer supported (see https://github.com/dart-lang/sdk/issues/30538) on web. The resolve package uses Isolate.resolvePackageUri and therefore support for web is broken. Although dart2js and dartdevc do not seem to complain (yet?), the pana package does not categorize this package as fit for web. Consequently, on https://pub.dartlang.org/packages/resource , web is also not listed as supported platform.

This also means that other packages depending on resource and importing dart:html, have conflicting components and cannot be categorized by pana at all.

rbellens avatar Nov 03 '18 20:11 rbellens

The latest build_web_compilers should disallow dart:isolate imports on the web.

We need to either go forward with a faked solution like #36 or drop support for the web from this package.

See also https://github.com/dart-lang/sdk/issues/37153

natebosch avatar Jun 04 '19 17:06 natebosch

@lrhn - could you take a look?

natebosch avatar Jun 04 '19 18:06 natebosch

If Isolate is not available, then this package won't work. There is no other defined way of accessing the information necessary to perform the operations of this package.

So, yes, it doesn't work on the web any more.

lrhn avatar Jun 06 '19 06:06 lrhn

@lrhn if you wish to preserve the old behavior on the web, one option here would be to duplicate the logic that we used to have in the web implementations of Isolate.resolvePackageUri (possibly dart2js's which had support to override the prefix used to fetch resources from the server). The code is pretty small (5 LOC), so it is a small change overall.

If web support is not a goal, it would be nice to update the package to delete the unsupported code and indicate more clearly that it is only meant to be used on the VM.

sigmundch avatar Jun 07 '19 19:06 sigmundch