Garlic.js
Garlic.js copied to clipboard
Include Location#hash in Path
This will make Garlic friendlier to things like Ember.js
Two quick notes:
- I couldn't get the test suite to run on my local machine, and I was kind of hoping this would be a bit more automated (e.g.
npm install ; npm test
) — EDIT: I've added #69 to resolve this problem - I haven't the foggiest clue how to add a test for this
Tests seem to be failing randomly, I'll investigate the issue soon. I think there's an issue with the test runner itself.
@guillaumepotier would you be interested in pairing on this with me? I can't figure out why this is failing, but I'm nearly 100% certain it has something to do with the way jQuery and Zepto are being loaded in the test runner.
This seems to be only a partial solution. There are two problems when using Ember:
- Without Location#hash, there could be conflicting entries in
localStorage
. Pretend, for example, that our application lives at this URL:example.com/app#/
, and some forms take the URLexample.com/app#/forms/<ID>
. It's abundantly clear that without Location#hash keys may conflict. - When submitting forms URLs such as the following are generated:
example.com/app?blah-radio=One&blah-checklist%5BOne%5D=on&blah-checklist%5BThree%5D=on#/forms/123
. It seems that intercepting thesubmit
action is causing a conflict between Ember and Garlic.
Can we get this merged? Really useful if pushstate is not an option.