Garlic.js icon indicating copy to clipboard operation
Garlic.js copied to clipboard

Include Location#hash in Path

Open jherdman opened this issue 10 years ago • 5 comments

This will make Garlic friendlier to things like Ember.js

jherdman avatar Jun 04 '14 18:06 jherdman

Two quick notes:

  1. 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
  2. I haven't the foggiest clue how to add a test for this

jherdman avatar Jun 04 '14 18:06 jherdman

Tests seem to be failing randomly, I'll investigate the issue soon. I think there's an issue with the test runner itself.

jherdman avatar Jun 04 '14 21:06 jherdman

@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.

jherdman avatar Jun 05 '14 12:06 jherdman

This seems to be only a partial solution. There are two problems when using Ember:

  1. 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 URL example.com/app#/forms/<ID>. It's abundantly clear that without Location#hash keys may conflict.
  2. 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 the submit action is causing a conflict between Ember and Garlic.

jherdman avatar Jun 05 '14 14:06 jherdman

Can we get this merged? Really useful if pushstate is not an option.

LorenzBischof avatar Oct 12 '15 16:10 LorenzBischof