fxa / uritemplate-js

An javascript implementation of RFC6570 Uri Templates
MIT License
97 stars 20 forks source link

Other URI Template implementations #2

Open rodneyrehm opened 12 years ago

rodneyrehm commented 12 years ago

Hey Franz,

nice work! Of course I only found your implementation hours after publishing my own. Just wanted to point you to uri-templates by Marc Portier and my URITemplate. I did a little performance testing - your implementation is clearly in the lead. grats!

How are your plans regarding the extraction of values through templates coming?

fxa commented 12 years ago

The extraction is not prio 1, first I have to make the bug fixes -- Mark Nottingham added some new test cases to https://github.com/uri-templates/uritemplate-test and my implementation fails that new tests. Of course only a subset of templates are extractable, and it is no easy job to determine, which are. So I will start with very simple one and then extend, when needed. e.g. I will start with only complete path segments ("/fixed/{segmentVar}/anotherfixed") and disallow explosions ("*")

By the way, I can completely understand your thoughts about the rfc. All your points. And I have some amendments: the encodings of the uri template rfc do not match the encodings of the uri rfc. For example, the '@' has to be encoeded to %40 for {?x} but is allowed in uris like http://www.example.com?a=@ But the uri rfc is so complex and there is no test case project...

By the way, you are from germany, too. Why are we talking Englisch?

rodneyrehm commented 12 years ago

So I will start with very simple one and then extend, when needed.

I was considering trashing my own implementation and simply referencing yours in URI.js. Which would only make sense if yours allowed extraction before I could get around to implementing it.

By the way, you are from germany, too. Why are we talking Englisch?

Yes, I'm from Germany. We are speaking English because this is the OS world and other may want to chime in. :)

Almad commented 12 years ago

+1 for extraction support ,)

mb21 commented 10 years ago

@rodneyrehm You didn't get around to implementing extraction, right? geraintluff/uri-templates seems to do the job or do you know of a better implementation?

rodneyrehm commented 10 years ago

I've not implemented this in URI.js yet. I'm rather playing with the idea of binding an external library and throwing out my own implementation. But I haven't looked at the problem in a while. Feel free to open another issue over at URI.js

fxa commented 10 years ago

@mb21 You are right, I did not manage to implement extraction, yet. I saw the implementation you mentioned, but I did not test it