Two big milestones in API-First Drupal
Two big “maintainability” milestones have been hit in the past few days:
1. rest.module
now is in a maintainable state
For the first time ever, the issue tracker for the rest.module
Drupal core component fits on a single page: https://www.drupal.org/project/issues/drupal?component=rest.module. 48 46 open issues, of which several are close to RTBC, so that number will likely still go down. Breakdown:
- 19 of those 48 are feature requests.
- 6 are “plan” issues.
- At least 10 issues are related to “REST views” — for which we are only fixing critical bugs.
- And 12 are postponed — blocked on other subsystems usually.
(There is overlap among those breakdown bullets.)
Finally the REST module is getting to a place where it is maintainable and we’re not extinguishing whatever the current fire is! It’s been a long road, but we’re getting there!
2. Instilling API-First responsibility
Two days ago, #2910883: Move all entity type REST tests to the providing modules landed, which is a huge milestone in making Drupal 8 truly API-First: every module now owns its REST test coverage, which conveys the fact that every component/module is responsible for its own REST API-compatibility, rather than all responsibility lying in the rest.module
component!
This is largely made possible by \Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase
, which is a base test class that each entity type should subclass to test how it behaves when exposed via REST. Every entity type in core has tests based on it, but contrib and custom entity types are encouraged to do the same!
API-First ecosystem
But the rest.module
being stable is not the only thing that matters — it’s a key part, but not the only part of API-First Drupal. The remaining challenges lie elsewhere in Drupal: the issues tagged API-First Initiative are now mainly in the modules providing field types, entity types, Entity/Field API and Configuration API.
The good thing is that the fixes to any of those always help the entire API-First ecosystem:
- core’s
rest.module
- https://www.drupal.org/project/jsonapi
- https://www.drupal.org/project/graphql
- https://www.drupal.org/project/relaxed
- https://www.drupal.org/project/openapi
- …
If you want to follow along a bit more closely, or want the news right as it happens, follow REST: top priorities for Drupal 8.6.x!