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
should HTML Imports support package: scheme? #12867
Comments
Marked this as blocking #11034. |
hmm, we discussed this, while it's not 100% clear here are a few data points: * at deploy time, none of this matters because we'll deliver the app as flattened HTML+JS/Dart files * at development time, we can handle this in HTML Imports boot.js another data point: Web UI used to support this, it seemed natural enough. |
We have reuse today, with <link rel="import" href="packages/foo/components/foo.html"> What problems do you foresee with this scheme? |
@seth - It doesn't canonicalize files properly leading to bugs like the 11034. Also it depends on symlinks on disk, which the Pub folks don't like. I'm actually not sure it even works if you have one component package depend on another one since Pub doesn't create symlinks inside packages lib folder |
Dropping to High, which still means that we need to solve for M8. Removed Priority-Critical label. |
Once the new dev server is in place, if we can presume users are going through that, then the symlink issue here is resolved. Pub serve handles "packages/" URLs directly without looking for them on the file system. |
Issue #13684 has been merged into this issue. |
@bob -- interesting. what does that mean for canonicalization? is the idea that Pub will handle both: packages/foo/packages/bar/bar.html ... and issue a redirect to the browser, so it knows they're the same file? |
(for the record, I'm strongly in favor of avoiding "package:" in HTML if possible... having a new URI scheme in HTML is tricky) |
Ugh, canonicalization. No, we don't currently do anything special to handle that. With Dart code, I believe we don't need to (though I could be wrong). If the code is using "package:" everywhere, the resolved URLs should be effectively pre-canonicalized. References to stuff in non-Dart code that's using "packages/" explicitly is harder. But, then, does canonicalization matter if the thing being referenced isn't a Dart file? |
yeah, HTML Imports do canonicalization for similar reasons -- to avoid loading the same HTML twice. |
Added this to the M8 milestone. |
This comment was originally written by @zoechi Any progress? dart2js doesn't work for elements which import elements from other packages as pointed out in 13684. I have also some troubles with those elements in Dartium which may be caused by the import workaround. This is the biggest obstacle for my work currently. |
This comment was originally written by @zoechi may https://code.google.com/p/dart/issues/detail?id=12400 be related to this too? |
We don't have a solution yet. The best workaround I have currently is to follow this convention: So when you join the paths, packages get resolved correctly. Using your example from the other bug: dartclient - web/index.html: elements_a - lib/my_login.html |
This comment was originally written by @zoechi This still doesn't work. It works somehow in Dart (but I guess some other problems I face are caused by this - especially with elements extending others - have to investigate further) pub build output: When I change the path so that it works with pub build (remove ../../) it doesn't with Dart. |
We'll need to find another solution :| "package:" is not supported by HTML. Added WontFix label. |
It seems like this feature would be useful for the exact same reason it is useful in Dart code--so packages can reuse widgets and be bundled into a package manager. On the other hand, I can't imagine native support for this in the browser. What should we do?
The text was updated successfully, but these errors were encountered: