Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Symfony 8.1

Symfony 8.1

Architecture, async, and developer experience — what actually changes for production apps.

Présentation canonique Slidewire — @matyo91 / Darkwood.

Avatar for Mathieu Ledru

Mathieu Ledru

November 06, 2026

More Decks by Mathieu Ledru

Other Decks in Programming

Transcript

  1. Darkwood · Symfony · 2026 Symfony 8.1 Architecture, async, and

    developer experience - what actually changes for production apps. HTTP-less kernel → Messenger ops → CLI = HTTP parity @matyo91
  2. Overview Symfony 8.1 - a minor release, major operational leverage.

    HTTP-less kernel DeepCloner DI for workers Dynamic attributes API layer Messenger ops JSON streaming Console resolvers Validator 01 | overview @matyo91
  3. Why it matters Two platforms, one framework clearer boundaries, less

    boilerplate. Non-HTTP runtimes Production async Workers and CLI boot a lean kernel without HttpKernel baggage. Messenger throughput, decode recovery, and cross-service contracts. High leverage for long-running processes, APIs, and operational tooling. 02 | why @matyo91
  4. HTTP-less applications Kernel moves to DI - boot a container

    without HTTP. AbstractKernel + KernelTrait replace MicroKernelTrait for workers, consumers, and CLI-only apps. ServicesBundle 03 | http-less ConsoleBundle @matyo91
  5. Slide 5 · 1/1 · représentation statique HTTP-less · architecture

    Entry points share DI - HTTP is optional. Entry points HTTP Console Messenger consumer AbstractKernel + KernelTrait DI Container 04 | http-less-arch Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/symfony-8-1 @matyo91
  6. Backend · VarExporter DeepCloner replaces serialize/unserialize graphs. 4× faster Portable

    payloads Built-in usage Typical object graphs; up to 15× on heavy property sets. toArray() / fromArray() - ~30– 40% smaller than serialize. Container compile, Form snapshots, ArrayAdapter cache. $clone = (new DeepCloner($graph))->clone(); $payload = (new DeepCloner($graph))->toArray(); 05 | deep-cloner @matyo91
  7. Dependency Injection DI built for long-running workers. Env as Closure

    Stack decorators Explicit #[Target] Refresh DB URLs and Declarative decorates / Parameter-name alias secrets via decorates_tag - drop matching deprecated resetEnvCache() - no custom compiler passes. Symfony 9.0. rebuild. 06 | di @matyo91
  8. DI · code Runtime env refresh in workers. public function

    __construct( #[Autowire(env: 'DB_URL')] private \Closure $dbUrl, #[Target('image')] private StorageInterface $storage, ) {} 07 | di-code @matyo91
  9. Dynamic controller attributes Controller attributes are mutable per request. _controller_attributes

    stored after first resolve - listeners override #[Cache], #[IsGranted], custom attrs. Dedicated events: kernel.controller_arguments.{AttributeFQCN} 08 | attributes @matyo91
  10. API layer Input and output - less manual wiring. #[MapRequestPayload]

    #[Serialize] Multipart files in DTOs · variadic Return objects - Symfony builds unpacking · dynamic validation groups. Response + Content-Type + context. 09 | api @matyo91
  11. Async · Messenger Throughput knobs for production workers. php bin/console

    messenger:consume async \ --fetch-size=8 --no-reset=100 --fetch-size - batch round-trips --no-reset - balance state vs speed 10 | messenger-throughput @matyo91
  12. Slide 12 · 1/1 · représentation statique Async · reliability

    Poison messages and polyglot consumers. serializedTypeName header Transport decode fail Retry / failure pipeline ok Handler Worker Decode failures route through retry/failure transports - not silently dropped. 11 | messenger-reliability Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/symfony-8-1 @matyo91
  13. Serialization · JSON Stream and query large JSON without loading

    it all. JsonStreamer JsonPath ValueObjectTransformerInterf #[AsJsonPathFunction] - domain filters without preprocessing pipelines. ace - compact domain scalars · timezone-aware DateTime. Relevant for APIs, log streams, RAG document stores. 12 | json @matyo91
  14. CLI & DX Console gains HTTP-style argument resolvers. public function

    __invoke( #[Argument, MapEntity] User $user, #[Option, MapDateTime(format: 'Y-m-d')] \DateTimeInterface $date, #[Autowire(service: 'messenger.bus.async')] MessageBusInterface $bus, ): int {} 13 | console-resolvers @matyo91
  15. CLI & DX Interactive CLI with validation parity. #[Ask] /

    #[AskChoice] #[MapInput] Prompts + Validator constraints · image paste via InputFile. DTO validation like # [MapRequestPayload Multiple commands per class · shared constructor ]. deps. 14 | console-dx #[AsCommand] on methods @matyo91
  16. Slide 16 · 1/1 · représentation statique Workers · AI

    · orchestration 8.1 aligns the worker stack endto-end. AI / RAG pipelines CLI commands resolvers + MapInput Messenger bus HTTP-less consumer fetch-size · no-reset Services via DI env Closure · DeepCloner 15 | workers Version interactive (mise en ligne à venir) : https://slides.darkwood.com/slides/symfony-8-1 JSON stream / polyglot type @matyo91
  17. Validator Deterministic rules and safer nested validation. #[Assert\Xml] - XSD

    validation with line-numbered violations Clock-aware date constraints - MockClock in tests validateInContext() - reentrant validators (nested DTOs) enablePropertyMetadataExistenceCheck() - catch property typos 16 | validator @matyo91
  18. Most impactful Five changes worth adopting first. 01 HTTP-less kernel

    for workers 03 Console argument resolvers 0 Messenger fetch-size & 2 decode recovery 04 Env vars as Closure in DI 0 #[Serialize] + payload 5 mapping gaps closed 17 | impact @matyo91
  19. Takeaway Symfony 8.1 in practice Lean workers + Reliable async

    + CLI = first-class Upgrade path is incremental - adopt per entry point, not big-bang. 18 | practice @matyo91
  20. Conclusion Symfony 8.1 sharpens boundaries - HTTP, CLI, and async

    each get the right kernel. Less boilerplate. Faster compiles. Production Messenger fixes. Same Symfony mental model. 19 | conclusion @matyo91
  21. References · Darkwood Links & resources Symfony Darkwood symfony.com/blog -

    8.1 release darkwood.com github.com/symfony/symfony github.com/darkwood-com symfony.com/doc/current/setup/upg rade_minor.html @matyo91 20 | merci @matyo91