-
Notifications
You must be signed in to change notification settings - Fork 39
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
feat: add catch all routes #197
Conversation
@mtt-artis, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction. |
@mtt-artis, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed. |
@mtt-artis, VMware has rejected your signed contributor license agreement. The merge can not proceed until the agreement has been resigned. Click here to resign the agreement. Reject reason:
|
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.
Hello @mtt-artis !
Thank you very much for this amazing PR! This feature is really valuable and it brings more parity with other frameworks like NextJS. I'm going to create a new issue for this and link it to the PR.
Regarding the CLA, you need to complete the missing data. Sorry for any inconvenience on the process!
hello @Angelmmiguel |
@mtt-artis, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed. |
@mtt-artis, VMware has approved your signed contributor license agreement. |
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.
hello @Angelmmiguel
i had some changes so that route /sub/[id] is better than route /[id]/sub
if you don't like it, i'll revert and fix the
(Some(), Some()) => return RouteAffinity::CanManage(i32::MAX - depth),
Hello @mtt-artis!
Thank you for the refactor and all the changes to support "catch all" routes. The current approach simplifies how wws
retrieves the right worker on runtime. It doesn't need to compute the affinity of all the routes based on the given path on every request.
I added some minor comments, but everything LGTM! Adding @ereslibre also as a reviewer to this PR before merging it :)
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.
Thanks for your contribution @mtt-artis! It's looking great. Some comments from my side.
Thank you for the code review and the advices. |
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.
LGTM besides the suggested 'satic' -> 'static' spelling changes.
Thank you @mtt-artis!
Sorry for that... Will fix it tonight |
There is only one remaining linting issue. |
Sorry again. You can fix it yourself if you want. Otherwise I'll do it late at night 😁 |
Don't worry! Thanks :), I have pushed a fix, it should be fine now, sorry for suggesting deriving |
The only thing missing for this feature to be considered complete is to write docs at https://github.com/vmware-labs/wasm-workers-server/tree/main/docs. I think is fine to address it on a separate PR. |
@mtt-artis, again thanks for your contribution! And a very nice Rust contribution for being your first one on this language! I have filed #213 too in case you also want to document this feature. I can take over on that if you prefer, as you wish :) |
It's cool if you take over. |
hey 👋
this is my first contribution to a rust project.
Description
This PR introduces a catch-all route segment to the route definitions. The catch-all segment is defined as
[...segment]
and allows for handling routes that haven't been matched by previous patterns.i don t know how the actix server should behave when two catch-all-routes are defined
ex:
/[...segment_a].js
/[...segment_b].js
/[...segment]/other.js
but it is quite the same with dynamic params
/api/[id]/index.js
/api/[slot]/index.js
Testing
Checklist
It closes #199