Per #1903784-16: Move serialization to own module, we temporarily moved Serialization from a core/lib component to a module due to limitations of components at that time that have since been resolved, and due to anticipation of what would be added to Serialization module that ended up not happening. We added a "revisit before beta" tag at the time we did that, but when we revisited it in #1903784-25: Move serialization to own module, we decided to punt moving it back to a component to D9. So, this is the issue to do that.

CommentFileSizeAuthor
#6 2296029-6.patch47.61 KBdawehner

Comments

catch’s picture

Version: 9.x-dev » 8.x-dev

Seems like there's a couple of ways we could move towards this without breaking bc:

1. If we do the plugin idea from one of the original issues, we could add a /new/ core service using the plugins, serialization module would then be a bc-layer providing the old services. That's fine for a minor release.

2. If this ends up just moving the services to core.services.yml and no module, then that could happen and leave an empty module that doesn't do anything. There's potentially an issue with conflicts (say a competing module registering the same service names that requires serialization to not be installed?) but not sure how much of a real issue that is.

So I'm moving this back to 8.x on the basis that the situation can be improved there - if either #1 or #2 happened the only task for 9.x would be git rm.

clemens.tolboom’s picture

Is this still targeting 8.0.x ?

wim leers’s picture

Version: 8.0.x-dev » 8.1.x-dev

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dawehner’s picture

Paramconverters, Event listeners etc.
Paramconverters, which are never expected to be used directly either as services or value objects, are not considered part of the API. You should not extend from these classes and provide your own implementation instead.

This really sounds similar to what encoders/normalizers are meant to be used for. On the other hand there are interfaces in there, we should certainly keep with a deprecation notice.

dawehner’s picture

StatusFileSize
new47.61 KB

For now I just moved all the classes but when I talked with @damiankloip about it, we kinda agreed that many of the classes are probably extended.

dawehner’s picture

Do we think we want to tackle that in 8.2.x?

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

larowlan’s picture

Issue tags: +Default content
wim leers’s picture

Status: Active » Needs work

For now I just moved all the classes but when I talked with @damiankloip about it, we kinda agreed that many of the classes are probably extended.

Indeed. So this probably needs to leave a BC layer… and that's not going to be pretty AFAICT.

larowlan’s picture

Beauty is in the eye of the beholder ;)

damiankloip’s picture

hehe. It is indeed. I would say that this should now just be punted to D9...

dawehner’s picture

@damiankloip
If someone would do it, I'd be happy with it, but yeah the effort around the BC would be quite a bit actually. Maybe someone comes up with a clever script though.

catch’s picture

I'm not sure this is worth doing in-itself for 8.x. However with an ugly bc layer, it would mean forward-compatibility if we wanted to do it in 9.x (i.e. an 8.x module could rely on the new classes, and work on 9.x with no changes). That in turn makes it worth doing for 8.x again ;)

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

wim leers’s picture

Well there's also #2575761: Discuss a better system for discovering and selecting normalizers that explains how the current normalizer selection system (i.e. Symfony's system) is a major PITA for something like Drupal. The Symfony serializer component works great if you write a normalizer for each object type, and can call it a day.

But Drupal doesn't use just objects… it uses object hierarchies (entities contain fields which contain field item lists which contain field items), and each level can have its own normalizer.

On top of that, modules can extend/decorate/override normalizers to suit their own needs.

With service priorities, this is an incredibly brittle PITA.

Therefore, I'd vote to won't-fix this because #2575761: Discuss a better system for discovering and selecting normalizers already implies we'll need to replace the Serializer component in D9.

damiankloip’s picture

Yes, essentially my vote would still be to not do this/won't fix it.

The forward compatibility would be a very good argument, but as Wim suggests above, we will very likely want to re-architect how our serialization API looks for D9. It needs to be completely re-thought out based on our needs and good experience from the evolution of D8. This could mean making a new component instead and just removing the serialization module. I think we were too hasty to just go with the Serialization component, and also it was added before a lot of other entity API stuff existed - meaning it has just got more tangled over the last few years. So based on that, I think we live with what we have currently.

Marking this as won't fix for now. If anyone disagrees, please re-open and we can talk about it!

damiankloip’s picture

Status: Needs work » Closed (won't fix)
wim leers’s picture

#17: great additional information about the context & evolution of the Serialization module :)