-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Deprecate route format
, replacing with pattern
#3329
Comments
- Prefer inline transforms to take place in `handle()` rather than `render()` - Avoid inversion of control by removing `BaseWordpress#handle()`, passing `extensionType` into `fetch()`, and removing one layer of subclassing - Move “not found” checks into `fetch()` - Cache wordpress versions instead of fetching on each request - Start to convert aliases to redirects (there are more of these which could be tackled in a follow-on) - Replace at least one route `format` with a `pattern` (ref #3329) - Partially reorder: name, category, route, examples, defaultBadgeData, render, fetch, handle Some of this is in line with our established patterns or makes it clearly easier to follow; some of it is arguably stylistic.
This now relies on the order in which these are registered, though that seems okay. Exporting them as an array guarantees that. Ref #3329
This now relies on the order in which these are registered, though that seems okay. Exporting them as an array guarantees that. Ref #3329
With the PRs for #3714 merged, outside of legacy redirectors there aren't many of these left! |
One of the last remaining non-redirect ones is Wercker. I've sat down twice now to attempt to convert but it's a bit of an 👀 popper. shields/services/wercker/wercker.service.js Lines 22 to 29 in ddbe19f
Based on the dialog in #2076, my sense is that there's two different types of build status we support from Wercker that require two different types of input (one an ID and the other the user/app name combo). I'm thinking it might be easiest to split these in two, at least the service route definitions, with a base class/reusable functions for all the common bits. Does that sound reasonable? |
There's an explanation of why splitting it is hard at #2279 (comment) Once you split them into 2 services, we can't control the order the routes get matched in. That said, as a related issue, what we're doing on the wercker badge is also a bit strange anyway (see point 3 on #2103 ). One of the routes that exists does an unexpected thing for legacy compatibility reasons. At the time we did that, we had no idea how many users might be relying on the wercker badges, but now we have stats we know that we've served less than 1,000 total requests for the wercker badges in the last month. Given all that, I'd be happy to:
|
Another of these where we're still using a |
* Change [issuestats] redirector from format to pattern Ref #3329 * Match other services where this approach was taken
To make the code easier to understand and to support trie-based routing for #3328, it would be helpful to replace the several remaining instances of route
format
s withpatterns
.Many of the remaining
format
s are designed to support aliases, and since we've started using redirects heavily, the likely solution is to rewrite the canonical form using a pattern, and add redirects for each of the alias forms.Ideally by using multiple redirects we can rewrite everything using patterns.
The text was updated successfully, but these errors were encountered: