4.0:
http://plnkr.co/edit/HsO6Dwtv1L4CDYi10Gv9?p=preview
3.0:
http://plnkr.co/edit/KSLgxEQveieLKWo5okxt?p=preview
In 3.0, choo properly detected the "base" route inside an iframe as /. Now in 4.0, it's forcing me to use the document.location.pathname of the iframe.
I would prefer to use / inside of iframes, but I don't know enough about routing to know if this is a bug/limitation/whatever.
Oh that's interesting - not entirely sure what's causing that - I think it might because of how we initialize our base route in https://github.com/yoshuawuyts/sheet-router/blob/master/create-location.js. The 4.x routing patch was intended to make apps / mobile / electron easier to use, I hadn't really considered iframes at all so thanks for reporting!
What might work (untested) is setting a base tag so it resolves correctly - https://developer.mozilla.org/en/docs/Web/HTML/Element/base - could you let me know if that perhaps works?
No luck using the base tag.
<base href="/"> won't even load the script (since the script is hosted in a /generatedkey path)
<script type="text/javascript">
document.write("<base href='" + document.location.pathname + "' />");
</script>
loads the script, but gives me the same error as before.
Some tools moarn about base-tag not being a full-qualified URL (with protocol, subdomain and domain). Although absolute or even relative paths are valid according to the spec.
IIRC there were some differences between window.location, document.location and document.URL when it comes to iFrame …
Released https://github.com/yoshuawuyts/microcomponent recently; think we're close to getting a good set of choo modules wired up in a standalone package aimed to be integrated in other libs. Most things don't need a router, so might as well make it standalone. Sooon :sparkles:
__edit:__ linked to the wrong package
So choo@6 will solve this completely, where as per #480 we'll be prototype based which means you can set your own app.router. So for iframes you could create a simple router that doesn't try and parse window.location stuff C:
should this be closed now that choo@6 is out?
@goto-bus-stop yep I think so. Closing!
Most helpful comment
should this be closed now that choo@6 is out?