Problem/Motivation
HAL was introduced during the development of D8. However, it never got much traction in the decoupled scene due to the vague specification and the particular quirks of the Drupal implementation. As a result few sites are using HAL in production. This speaks not to its usefulness, but to its worthiness to be shipped with core.
Additionally, JSON:API was recently committed into core and offers a superset of features over HAL. This makes HAL redundant in our codebase.
Finally, it's worth mentioning that the HAL module does not have any official maintainers. And has not had one for a while (4 years): https://git.drupalcode.org/project/drupal/blob/8.8.x/core/MAINTAINERS.tx...
Proposed resolution
1. Create a HAL project in contrib.
2. Deprecate HAL module in core in 9.3.x
3. Remove HAL module from 10.0.x
Remaining tasks
Agree on the deprecation strategy described.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
TBD
Comments
Comment #2
e0ipsoComment #3
e0ipsoI created #3049857: Remove HAL module from core and create a contrib project for it for the actual removal of HAL in D9.
Comment #4
Wim LeersComment #5
larowlanI've at least two contrib modules relying on hal - default_content and entity_pilot
I'd be happy to step up as maintainer if that's the primary removal reason
Comment #6
jibranIt is not just the maintainer issue. After adding JSON:API to core, the functionality HAL provides is almost the duplicate. The contrib modules require HAL can simply require
drupal/hal
using composer and will continue to work in D9.Comment #7
Gábor Hojtsy@mixologic has a core module usage breakdown snapshot from a few months back. I don't remember HAL usage from there, but it would be nice to see. The data is being reported to d.o by those sites using update module at least, which would be indicative of relative use (definitely not as absolute numbers), assuming we want to derive supporting data based on sites using update.module.
Comment #8
e0ipso@Gábor Hojtsy do you think we should make this decision based on usage stats? That only speaks to one of the claims in the issue summary. The other two (no maintainers & being redundant now that JSON:API is in core) are still relevant regardless of the usage, right?
Comment #9
Gábor HojtsyI don't think that should be the only condition of decision, but it could help inform the decision.
Comment #10
e0ipsoAnyone has ideas on how to move this forward?
Comment #12
BerdirToo late for D8.8, but I think moving it to contrib makes sense.
There are various issues that are very hard to resolve, see for example #2925520: Add a computed 'file_url' property to FileItem (for exposing file URL in file field normalization).
I'm also still relying on this through the default_content module, but hal+json became IMHO less and less convenient for that use case as core tried to make it more useful for REST, by adding more data, formatted representations, computed fields, formatted dates.. all things that are just in the way for how default_content uses it.
I've some thoughts on adding a custom serialization format to default_content that still covers what it needs (relationships, specifically but also things that are hard right now like files) while keeping it as close as possible to the raw data structure. There's also yaml_content as an alternative, but it's only alpha and has very few usages compared to default_content.
Comment #13
catchTagging.
Comment #15
xjmMoving this to the Ideas queue for discussion there. (We separate the policy discussion from implementation for these since there are different needs.)
Comment #16
Gábor HojtsyThe lack of maintainership is a problem. I agree the duplication of functionality is not useful either. Also JSON:API by this time has a much larger ecosystem of modules around it compared to HAL I believe. That said, #3158669: By default deprecate non-experimental modules that are used by less 5% of sites before the next major version indicates 12.5% use of HAL among reporting sites at the time. Given all of the above I would still lead to deprecate in Drupal 9 with removal for Drupal 10.
Comment #17
Gábor HojtsyParenting to the right Drupal 10 meta. Removing product signoff tag, since I provided that in #16.
Comment #18
catchWe are a bit blocked on implementation with #3135100: [policy and meta] Provide a proper mechanism for deprecating modules and themes, but in terms of the overall decision, untagging for release manager review.
Comment #19
catchNow that the lifecycle key has been added to .info.yml we're no longer blocked on implementation. Is anything more needed before we can go ahead with this one?
Comment #20
catchMarking this RTBC, I've also unpostponed #3049857: Remove HAL module from core and create a contrib project for it.
Comment #21
andypostThere's nothing ce contrib instead of it
https://www.drupal.org/project/jsld
Comment #22
larowlanThis is done now