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

What's new in Symfony 7.x

What's new in Symfony 7.x

With the recent release of Symfony 7.0, a new development cycle has begun for your favorite PHP framework. With PHP 8.2 as the minimum version, this is also an opportunity for the community to explore the new possibilities offered by the language. But what has happened in a year? In this talk, I offer you a retrospective on the improvements made to Symfony. New components, enhancements to existing components, as well as new practices and related deprecations, etc. Exciting sources of inspiration for your upcoming projects.

Nicolas Grekas

October 09, 2024
Tweet

More Decks by Nicolas Grekas

Other Decks in Technology

Transcript

  1. is a set of low-level building blocks that you can

    assemble to develop powerful high-level features easily
  2. Continuous Upgrade Path • Not unannounced BC breaks • Fix

    deprecations every 6 months • Upgrade every 2 years for new major
  3. Community Work in Progress • 3k files changed, 33k (+),

    14k (-) • 180 minors • 134 features
  4. Thanks php-src #57461 Prefix all \sprintf() calls #57550 Replace `strtok`

    calls #57856 replace `uniqid()` with `random_bytes()`
  5. PHPUnit 11 #58507 [WIP] run unit tests using PHPUnit 11

    #58370 [WIP] run integration tests using PHPUnit 11 #58467 Support ClockMock and DnsMock with PHPUnit 10+
  6. Performance #57948 Optimize dumped resources for tracking #58233 [Mime] Cache

    finfo objects #57926 [AssetMaper] Fix entropy of hash in public paths
  7. New components #44681 Add the HtmlSanitizer component #46715 Add the

    Clock component #48542 Add the RemoteEvent and Webhook #47112 Add a Scheduler component #48371 Add AssetMapper to manage JS deps without nodejs
  8. Notifier/Mailer #54747 Add Primotexto bridge (Samael tomas) #57627 Add Sipgate

    bridge (Lukas Kaltenbach) #57683 Add JoliNotif bridge (ahmedghanem00) #57456 Add mailomat bridge (scuben) #57431 Add Sweego bridge (welcoMattic) #57903 Add Postal mailer (jonasclaes) #58252 Add Mailtrap bridge (kbond)
  9. Messenger #53508 Tell transports when messages are still being processed

    (HypeMC) #57507 Introduce `#[AsMessage]` attribute (pounard)
  10. #[AsCommand('app:alarm')] class AlarmCommand extends Command implements SignalableCommandInterface { protected function

    initialize(InputInterface $input, OutputInterface $output): void { $this->getApplication()->setAlarmInterval(10); } public function getSubscribedSignals(): array { return [\SIGALRM]; } public function handleSignal(int $signal, false|int $previousExitCode = 0): int|false { $this->output->writeln('handleAlarm'); } }
  11. Developer Xperience #57949 SYMFONY_DISABLE_RESOURCE_TRACKING #57804 Enable `json_decode_detailed_errors` in debug mode

    #57101 Add lint:translations command (Kocal) #58199 Add `--resolve-env-vars` option to `lint:container` (ostrolucky) #58028 Render a `block` via the `#[Template]` attribute (smnandre) #56823 Introduce named serializers (HypeMC)
  12. No-ops Hosting #58161 SYMFONY_TRUSTED_PROXIES/HEADERS/HOSTS, SYMFONY_TRUST_X_SENDFILE_TYPE_HEADER env vars #56985 Derivate `kernel.secret`

    from the decryption secret #58165 Remove default value for `gc_probability` config option #54384 Compile templates in kernel.build_dir when possible (Okhoshi)
  13. New components Under discussion: #51741 [ObjectMapper] (soyuka) #51718 [JsonEncoder] (mtarld)

    #53213 [FeatureFlags] (Neirda24/Jean-Beru) #53346 [Uri] (alexandre-daubois) #54013 [AccessToken] (pounard)