-
Notifications
You must be signed in to change notification settings - Fork 47
Support for email address ( resource with .) in resource uri #20
base: master
Are you sure you want to change the base?
Conversation
@rohitjoshi I don't think replacing all strings with constants should be done in the same PR as adding a support for Could you commit just the support for If you feel moving those constants to string improves something (like performance), i'd like see proof. I don't think it adds readability. On the contrary. |
@@ -41,12 +41,6 @@ describe("Router", function() | |||
assert.same(dummy.params, {id="2"}) | |||
end) | |||
|
|||
it("supports an extension on a param", function() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we definitely want to support those
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding support for dot (.) conflict with your requirement of supporting extension for the resource.
e.g you have a test case /resource/1.json
where you expect resource value to be 1
By adding support for ., it will return 1.json
e.g /users/[email protected]
should return [email protected]
So unless we remove support for extension, dot support will not work.
Regarding defining constants, I had ran this test long ago and most of the time JIT does optimize but with millions of requests, I was able to see the difference. I do agree performance gain may not be significant compared to readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a test testing support for the .
. I just see removing support for partial matching.
The tests are testing that /:id.json
extracts 1
. I don't see how that could conflict with /:email
matching the whole string. It might be not easy because of how it is implemented, but that does not mean it is not possible.
I can't merge such breaking functionality, sorry. I'd be fine merging it, if it would not break current tests and remove existing functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will submit another PR with
- email support
- remove const strings
/emails/:email/devices
and request uri is/emails/[email protected]/devices