With relative paths, even WebStorm's built in http server will serve up my Polymer app.But then, things get hairier when e.g. I've got a server side route at myapp.com/item/someitem whose controller simply serves the app:static showItem(App app, HttpRequest request, String item) {// Serve the app as usual, and client router will handle showing the item.return new File(config['server']['directory'] + '/index.html');}Suddenly, when I load myapp.com/item/someitem, all my package imports are looking in item/:What say you? Thank you!--D
--
You received this message because you are subscribed to the Google Groups "Dart Web Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web+uns...@dartlang.org.
Visit this group at http://groups.google.com/a/dartlang.org/group/web/.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/web/CACekCDmQOW_0pw3Fjy%3DvzTXK05JM%3DEHteYjMtes6%2BTE17YRXyw%40mail.gmail.com.
Do you mean specifically for <link rel="import"> and Polymer.dart ?
[Warning from ImportInliner on woven|web/index.html]:
web/index.html:12:5: absolute paths not allowed: "/packages/polymer/polymer.html"
Thank you for any guidance!
--
You received this message because you are subscribed to a topic in the Google Groups "Dart Web Development" group.
To unsubscribe from this topic, visit https://groups.google.com/a/dartlang.org/d/topic/web/szLsH84BpQo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/web/465d8f36-e23e-4703-8e31-217bd62784c0%40dartlang.org.
And in fact, pub build confirms that absolute paths are at least frowned upon (it's a warning, but says "not allowed").[Warning from ImportInliner on woven|web/index.html]:
web/index.html:12:5: absolute paths not allowed: "/packages/polymer/polymer.html"
Do I really have to convert all my relative paths everywhere to absolute paths? That would suck.
Just to clarify, this warning is coming from a polymer transformer, not pub build itself. So pub doesn't frown on absolute paths, but polymer may.
--
You received this message because you are subscribed to a topic in the Google Groups "Dart Web Development" group.
To unsubscribe from this topic, visit https://groups.google.com/a/dartlang.org/d/topic/web/szLsH84BpQo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web+uns...@dartlang.org.
Visit this group at http://groups.google.com/a/dartlang.org/group/web/.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/web/CAJmP2_rG%2BFjzyDnr71834jk9DHyydwpwj22UGf-3uT%2BiKOJ-9g%40mail.gmail.com.
Ok, so in order to get the app served properly when on URLs like item/whatever, including both pre and post build, I had to handle not only packages/ but also index.html and index.dart and their post build assets like index.html_bootstrap.dart.js (luckily, all those are nicely prefixed with index.html).
My code, see line 45: https://gist.github.com/DaveNotik/79bfc9455c742ec4f7afThis seems so bizarre. There has got to be a better way. Thoughts?
--D
--On Mon, Aug 25, 2014 at 3:54 PM, David Notik <da...@woven.org> wrote:
Great insights. Thank you Siggi! I'll try your server handling idea, and follow that bug.--DOn Mon, Aug 25, 2014 at 3:44 PM, 'Siggi Cherem' via Dart Web Development <w...@dartlang.org> wrote:
The reason we request to use relative and not absolute paths, is that it makes it possible to also support loading apps in Dartium even without running a server (using file:/// urls). Anyone writing a shared library will likely use relative paths to be able to support this use case.
Do I really have to convert all my relative paths everywhere to absolute paths? That would suck.I hope not. In fact, it might not always be possible, for example, if code in other packages use relative URLs and you can't change their code.You can probably work around the problem if you have the server respond to any URL containing 'packages/', for example not just '/packages/' but also 'mydir/packages/'. Alternatively, if all the URLs are on your code, then you could include a prefix on every css and image URL, and set the value of the prefix when you load the entrypoint (for example '{{prefix}}/packages/bar'). Note that HTML imports don't need this, because we inline and remove HTML imports from your app during the build step.Just to clarify, this warning is coming from a polymer transformer, not pub build itself. So pub doesn't frown on absolute paths, but polymer may.Correct - polymer transformers right now do not allow absolute paths. However, it might be possible to make transformers more flexible in the future.I just opened a new bug to make sure we look into ideas that can make this better, for example, maybe the build step can convert relative paths into absolute ones (see https://code.google.com/p/dart/issues/detail?id=20691)Cheers,Siggi--To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/web/CAJmP2_rG%2BFjzyDnr71834jk9DHyydwpwj22UGf-3uT%2BiKOJ-9g%40mail.gmail.com.
You received this message because you are subscribed to a topic in the Google Groups "Dart Web Development" group.
To unsubscribe from this topic, visit https://groups.google.com/a/dartlang.org/d/topic/web/szLsH84BpQo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web+uns...@dartlang.org.
Visit this group at http://groups.google.com/a/dartlang.org/group/web/.
You received this message because you are subscribed to the Google Groups "Dart Web Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/web/CACekCDkLhPStz%2BsD3KXga0ZHh2S38hYDahvfTW%3DH42_qPQx%3D8g%40mail.gmail.com.