-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose router engine for other implementations #13
Conversation
79a210a
to
2128709
Compare
@dougwilson Thoughts on an implementation like this? |
Hey, sorry, I've just been busy and haven't been able to look over this changeset yet (it's really big). The only thing I've noticed so far is you deleted a few tests, signaling it's not backwards-compatible, but I haven't look at anything else just yet. |
@dougwilson It should be backward compatible, those tests seemed to be testing implementation details by using Edit: We can easily keep |
Gotcha. So after the change, what does |
For example, there seem to be many, many people using |
The only change is that |
Ok, good to know. I'll add that functionality back now and ping you again 👍 |
By the way, one thing I noticed was |
ee1fc06
to
ebdf9c2
Compare
@dougwilson No backward incompatibility now. Edit: Added error throwing for missing |
ebdf9c2
to
ca93cae
Compare
@dougwilson Sorry to be so pushy, I just really want to publish a bunch of middleware on top of this 😄 Do you have any thoughts on the implementation? |
Sure. Sorry, it's hard to look through " 801 additions and 739 deletions" :) Do you have any documentation of how this new feature would be used? (so I can at least maybe only review the external API :P). |
I also don't completely understand what you're doing with this |
The implementation layer is pretty much I can also publish the module implementation I've implemented to show you how I'm using it. |
Yeah, sorry. Maybe there's a better way to document it, but it's basically the "fast match" route from before that you always expected to match (E.g. |
That's fine, and we can also exchange it privately if you feel that necessary :) But we'll probably want docs in the readme eventually, haha. |
I can try my hand at some simple documentation at the bottom of the readme. |
I don't know enough about the implementation to really comment :) |
From the title:
Based on your file names, I would expect that you'd have an exports of |
@dougwilson Ok, done. I copied some tests over, but the bulk of the changes I just made were because I realised there were some simple optimisations to do. Moved |
Actually, I shouldn't be coding at 1am. The reason people needed to implement these specifically was because other implementations can use a different number of arguments. However, the only difference for those users now will be that they can't rely on the methods already set up and can't use the |
Nice! And yes, that is my main concern: that the changes fit into a case where people can use it to build upon :) |
@dougwilson Well, if it helps, we've been using it in https://www.npmjs.com/package/osprey-router for the past few months. All the methods can (currently) be overridden if you need to support for arguments and I'll make that note in the README tomorrow. But maybe I'll remove the method implementations by default and add it back to the example, instead exposing the array from Edit: Well, that was conflicting. Still can't make up my mind if the default methods loop implementation should be there or not. There's no functionality change in any case. I think if we foresee more implementation sticking with one path argument it makes sense to leave it there and be overridden by the outliers. |
@dougwilson Ok, all done and dusted. The sample implementation in the README should be adequate for anyone else to get started. |
@dougwilson Have you had any more time to review this at all? Would love to re-open the discussion around unicode URLs once this is merged. |
79d7ee8
to
5b644ba
Compare
5b644ba
to
597a9ac
Compare
@dougwilson Any chance you could review this before too many more changes continue happening 😝 |
Sorry, I have just been so busy herding all these modules around :) I just finished looking through a lot of the Express 4.x issues, so this is on my backlog after getting 4.13.0 out to get this up to snuff and then into the 5.x branch of Express very soon to get a 5.0 beta out! I consider this issue a blocker to 5.0 beta and we really need to get 5.0 out next month, so I hope that signals the importance/timeline of this issue :) |
597a9ac
to
fca6d62
Compare
@dougwilson Just rebased back against the latest I just realised (maybe I did before) but this module still uses |
fca6d62
to
c21c365
Compare
@dougwilson Rebased against |
9bd7ae2
to
97d5110
Compare
97d5110
to
cbc1f0f
Compare
@dougwilson I need to continue working on this branch for promise support and router exiting, so I'm going to close this and reopen under a new PR. |
There's still a couple of things to decide, but it works wonderfully for what I need and can plug any other implementation in that supports the same function return syntax. Only issue I see is debugging since it currently relies heavily on human-readable paths to be passed to the engine.
Closes #12