Slide 1

Slide 1 text

What's new in Symfony 7.x @nicolasgrekas

Slide 2

Slide 2 text

is a set of low-level building blocks that you can assemble to develop powerful high-level features easily

Slide 3

Slide 3 text

symfony.com/releases

Slide 4

Slide 4 text

Backward Compatibility Promise • Upgrade every month for bug fixes • Upgrade every 6 months for features

Slide 5

Slide 5 text

Continuous Upgrade Path • Not unannounced BC breaks • Fix deprecations every 6 months • Upgrade every 2 years for new major

Slide 6

Slide 6 text

Community Work in Progress • 3k files changed, 33k (+), 14k (-) • 180 minors • 134 features

Slide 7

Slide 7 text

Minors

Slide 8

Slide 8 text

Symfony 7 • Add native types • Add generic types • Leverage new syntaxes

Slide 9

Slide 9 text

Thanks php-src #57461 Prefix all \sprintf() calls #57550 Replace `strtok` calls #57856 replace `uniqid()` with `random_bytes()`

Slide 10

Slide 10 text

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+

Slide 11

Slide 11 text

Performance #57948 Optimize dumped resources for tracking #58233 [Mime] Cache finfo objects #57926 [AssetMaper] Fix entropy of hash in public paths

Slide 12

Slide 12 text

Features

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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)

Slide 15

Slide 15 text

Dependency Injection #[AsDecorator] #[AsTaggedItem] #[AutowireCallable] #[AutowireDecorated] #[AutowireLocator] #[AutowireServiceClosure] #[AutowireMethodOf] #[AutowireInline]

Slide 16

Slide 16 text

Dependency Injection #57379 Add `#[WhenNot]` attribute (alexandre-daubois) #58004 Add `ContainerBuilder::registerChild()` (HypeMC) #57611 Introducing container non-empty parameters (yceruto)

Slide 17

Slide 17 text

$container->nonEmptyParameter( 'app.secret', 'Did you forget to configure the "app.secret" option?' );

Slide 18

Slide 18 text

Controllers #[CurrentUser] #[MapDateTime] #[MapEntity] #[MapQueryParameter] #[MapQueryString] #[MapRequestPayload] #[ValueResolver]

Slide 19

Slide 19 text

#[Route('/blog')] public function blog( #[MapQueryParameter] int $page = 1, )

Slide 20

Slide 20 text

#[Route('/product-review', methods: ['POST'])] public function post( #[MapRequestPayload] ProductReviewDto $productReview, )

Slide 21

Slide 21 text

String #58385 Add `AbstractString::kebab()` (alexandre-daubois) #57243 Add `TruncateMode` enum (Korbeil) #58228 Add Spanish inflector (dennistobar)

Slide 22

Slide 22 text

Uid #53060 Add UuidV1/6::toV6/7() (fancyweb) #58238 Mention RFC 9562 (fancyweb) => Migrate to lexicographically sortable UUIDs

Slide 23

Slide 23 text

Messenger #53508 Tell transports when messages are still being processed (HypeMC) #57507 Introduce `#[AsMessage]` attribute (pounard)

Slide 24

Slide 24 text

#[AsMessage(transport: ['first_sender', 'second_sender'])]

Slide 25

Slide 25 text

Console #53533 Add ability to schedule alarm signals (HypeMC)

Slide 26

Slide 26 text

#[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'); } }

Slide 27

Slide 27 text

Security #58095 Implement stateless headers/cookies-based CSRF protection (nicolas-grekas) #57525 Improve profiler’s authenticators tab (MatTheCat)

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

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)

Slide 30

Slide 30 text

serializer: named_serializers: api1: name_converter: 'serializer.name_converter.camel_case_to_snake_case' default_context: enable_max_depth: true api2: default_context: enable_max_depth: false

Slide 31

Slide 31 text

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)

Slide 32

Slide 32 text

New components Under discussion: #51741 [ObjectMapper] (soyuka) #51718 [JsonEncoder] (mtarld) #53213 [FeatureFlags] (Neirda24/Jean-Beru) #53346 [Uri] (alexandre-daubois) #54013 [AccessToken] (pounard)

Slide 33

Slide 33 text

UX Live Components ux-icons class-variance-authority Idiomorph and turbo 8

Slide 34

Slide 34 text

Credits

Slide 35

Slide 35 text

Hundreds of contributors

Slide 36

Slide 36 text

Backers for 7.1 And … your logo?

Slide 37

Slide 37 text

symfony.com/slack Twitter LinkedIn Mutual aid Kindness CARE team

Slide 38

Slide 38 text

Thank you and see you soon!