In looking through core.services.yml it seems like there's a lot of stuff in there we could benefit from being better-discoverable. In talking to jhodgdon about this, she recommended creating a feature request here about that.

Just like we have a list at https://api.drupal.org/api/drupal/functions/8 it'd be great to have one like this about services. Columns could be (examples):

- Name: router.route_provider
- Class: Drupal\Core\Routing\RouteProvider (linked to the class)
- Tags: name: event_subscriber <-- in my absolute perfect sunshine rainbow happy world, this would link to a list of all services tagged as "event_subscriber"

Comments

jhodgdon’s picture

I'm not sure about making the tags into a link, but we could have a "contains" filter on the tags column, similar to what we have on "namespace contains" etc. on the Classes page on api.drupal.org.
Anyway, consider this requested.

jhodgdon’s picture

Actually a list of routes would be useful too, and it would be useful if both routes and services were API module documentation "items", so that they could have individual lists of "100 functions reference this service" etc.

jhodgdon’s picture

OK, we don't need a list of all the routes (they are not reused much), but having routes and services be individual "items" would be good so that we can get individual "100 places use this" listings for both.

jhodgdon’s picture

Assigned: Unassigned » jhodgdon

I'm working on this one.

  • Commit 07ed533 on 7.x-1.x by jhodgdon:
    Issue #2244683 by jhodgdon: Parse services.yaml files to make a listing...
jhodgdon’s picture

I just made a commit for the first part of this: listing out the services and making item pages for services. That part is working and has tests.

I'm leaving this open and continuing to work on it though, as it needs more linking:
- If a function references 'name.of.a.service', it should link to that service's page. Currently it links to the YML file that defines the service.
- Conversely, the other way: Right now if you go to core.services.yml on my test site, you see "1467 string references to YAML keys in core.services.yml" -- eek! That is not useful. So what I want to do is take the string references to individual services out of that list, and show them on the services page, so you would see something like "20 references to cache.whatever" on the cache.whatever service page instead, which is way more useful.
- The class page should have a link back to the service that uses it.

jhodgdon’s picture

Latest commit: Link back from class page to service that uses it.

  • Commit f27f8e1 on 7.x-1.x by jhodgdon:
    Issue #2244683 by jhodgdon: Make service classes link back to the...
jhodgdon’s picture

Next commit: the rest of comment #6 (will commit shortly, as soon as the tests are finished).

The only other thing I can think of is that the tags are not currently listed on the Services listing page. It would be nice to list them, and to allow filtering. I'm going to see if I can make this happen.

  • Commit 8097b7c on 7.x-1.x by jhodgdon:
    Issue #2244683 by jhodgdon: Make service names link to service not YML...
jhodgdon’s picture

Status: Active » Fixed

OK, I figured out the tags, and this is committed too. This issue is done!

  • Commit b9c2755 on 7.x-1.x by jhodgdon:
    Issue #2244683 by jhodgdon: Add tags and tag filtering to service...
webchick’s picture

Oh, wow, great!! Where do you go to see it?

jhodgdon’s picture

It isn't deployed yet. Waiting on a critical issue in grammar_parser.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.