-
-
Notifications
You must be signed in to change notification settings - Fork 1
Stop using listeners for data extraction #43
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @lcobucci, thanks for looking into this, the change you made does indeed fix the issue.
I also think this solution is really nice in terms of extendibility.
The change you introduced shouldn't affect our existing Clients since it's done in a BC way.
If I'm not mistaken, as an upgrade path, the existing Clients should start removing the:
@Serializer\SerializedName(IdGenerator::GENERATED_ID)
From the id
property to be compatible with the next major release.
🎉
Correct! There's also the possibility of decorating the decorator (if needed): $extractor = new AppendGeneratedIdentifier(
new AppendGeneratedIdentifier(
new UseInputData()
),
'_input.id'
); That would send both It's important to remember that, if I'm not mistaken, you had some other event listeners which will need to be migrated to the new way of extracting data - they shouldn't be affected until the removal of the deprecated components, though. |
I'm just thinking about moving the interface and these extractors to |
This simplifies the deserialisation engine by moving away from events and allowing users to append data via object decoration.
Since we don't use events any more these are just useless.
17a45b1
to
4580144
Compare
@lcobucci do you have an example of replacing an injector with this decorator? Just to help migration path, maybe add this to an Use case: a injector that uses Or is this not affected? |
That injector doesn't need to be changed immediately after this release, only when we remove the deprecated components. IMHO this is a good example: I'll be documenting stuff soon but I'm terrible at that so any help is appreciated. |
We can help with the docs, also this PR then becomes a bit more self-documenting. How do we hook up a InputExtractor? is there a new tag? |
The idea is to rely on the SF DI decorator feature (using the interface as decorated service). Something like: <service id="MyCustomExtractor" decorates="Chimera\MessageCreator\InputExtractor">
<argument type="service" id=".inner"/>
</service> |
Aaah, interesting, did not know that. Nice. |
Fix #15
This simplifies the deserialisation engine by moving away from events and allowing users to append data via object decoration.
We should remove the deprecated components on the next release.
@dsantang @rdohms can you please help me ensure that we don't break all your apps?