-
Notifications
You must be signed in to change notification settings - Fork 1.7k
dart2js: Implementing Resource class #23825
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
fwiw, the VM landed support for Resource today, if you're curious to have a reference. |
It's not a great idea to rely on The VM will support reading Dart files, so it would be nice if dart2js did as well. It's not entirely clear to me where dart2js will look for resources at runtime, though. |
The only guarantee should be: if the resource is loadable by the runtime, at runtime, it should be loaded. If a build process or a user omits a resource from their bundled/packaged deployment, that's their call.
Even in the case of a snapshot? Not sure what happens in that case. |
If you stay within pub-world (that is, only run stuff in pub packages or via |
My main problem is deciding how to resolve 'package:' URIs at runtime. Currently I just resolve them with Uri.base.resolve('packages/$packageUri'); basically assuming the pub build structure. Should we be doing package resolution described in the .packages DEP (https://github.com/lrhn/dep-pkgspec/blob/master/DEP-pkgspec.md#resolving-package-uris) at runtime or just assuming pub build output? |
Assuming |
Another thing to consider: we likely don't want to expose the package-uri in the output program. Even the name of the package and it's structure can be considered internal private information for some developers. One way to address this is to place all resources next to the main output file (the name can be as simple as
Whoever embeds the output of dart2js can properly serve those resources by reading that map. That's basically what we do for deferred imports when you pass the |
Good catch. Let's close this issue. |
Tracking issue for the dart2js's implementation of Resource class.
See meta issue #23823
The text was updated successfully, but these errors were encountered: