@dunglas couple of days ago there was PR for 2.7.17 release of api-platform/core, which failed all tests in CI, but still was merged and broke a lot of CI/CDs including the one in my project. Literally any composer update. Any help needed?
I think the introduction of attributes in #PHP was a big mistake. I worked on a project lately, where some people decided that we use #ApiPlatform in combination with #Symfony.
This is not a rant against neither of these projects, but we ended up having attribute declarations in entity classes that are way longer than the entity itself.
It is strange, that all the #CleanCode principles just don’t apply any more if a statement starts with an # …
@phpandcigars we had a similar discussion in our team. As we work with hexagonal architecture, we decided to move all infrastructure attributes to dto's in the infra layer, and try to keep our domain or application classes free of them. And if we need domain validations, instead of making them in attributes we put them in constructors, for example. That way, we take profit of attributes on one layer, but we keep the rest "clean"
@appsinet@phpandcigars this is probably the point. you're probably exposing your ORM classes directly to your API.
This may seem practical, but in reality you're soon gonna regret it:
you don't own your entities: those are Doctrine classes, which the ORM istantiate itself, even skipping their constructor; use them to map to your DB, not much more!
you bound your DB definition to your API definition: whenever you'll want changes, you'll be stuck or creating cascading/unintended changes
The fairytale of legacyland! – want to know more? Holger und Boas haben in Lille ihre Erfahrungen bei der Migration des Backend-Teils einer Legacy Single Page Application auf Symfony und API Platform mit euch geteilt.
What I think is good is that I'm taking the good things from EasyAdmin (like admin config and fields definitions) and the good things from #ApiPlatform (generic state providers/processors) and I think I succeeded in making everything abstract.
Like you could use forms manually without the CRUD system, you can extend the AdminLayout without any "dashboard" config, etc.
It's like we're back in EasyAdmin 1 and 2 : since Svelte is only used as a template rendering engine, all the logic resides in Typescript (or Javascript in the future) classes that you instantiate anad configure, and all the templating is separated in order to be manually reused without the whole admin system (contrary to EasyAdmin 3 and 4 where it's really hard to reuse templates without the whole admin).
Nous vous souhaitons une belle fin de conférence si vous êtes à l'#APIPlatform Conference à Lille ! Pensez à vous arrêter sur notre stand : L'AFUP et l'API Platform Con vous permettent d'aller au Forum PHP 2023 au meilleur tarif dans 3 semaines. Allez dire bonjour à notre équipe pour tous les détails.