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

Here comes Symfony 6.3!​

Here comes Symfony 6.3!​

A lot has happened in the last 6 months. Are you excited about Symfony 6.3? Many are! Even if you follow the activity on the GitHub repository, I'm sure you've missed something that could be invaluable for your next project update. Let's have a look at the progress we made together as a community of contributors.

Nicolas Grekas

June 16, 2023
Tweet

More Decks by Nicolas Grekas

Other Decks in Technology

Transcript

  1. Symfony 6 • PHP >= 8.1 • Upgrade every 6

    months for features • Backward Compatibility promise • Upgrade every month for bug fixes @nicolasgrekas
  2. Symfony 7 • PHP >= 8.2 • Upgrade every 2

    years for new major • Continuous Upgrade Path promise • Fix deprecations every 6 months @nicolasgrekas
  3. 7 merges / day Since Nov 25th • 355 minors

    • 390 bug fixes • 223 features • 280 merges up • 42 releases @nicolasgrekas
  4. Performance #48802 Cut compilation time #49781 Improve perf. of translation

    messages extraction #49676 Improve perf. of GlobResource @nicolasgrekas
  5. Types #49383 Add missing return types to interfaces #49022 Add

    missing template annotation on ServiceLocator #48750 Add generics to PasswordUpgraderInterface @nicolasgrekas
  6. +/** + * @template-covariant T of mixed + * @implements

    ServiceProviderInterface<T> + */ class ServiceLocator implements ServiceProviderInterface, \Countable { @nicolasgrekas
  7. PHPUnit 10 #49663 Remove withConsecutive() calls from tests #49233 Use

    PHPUnit 9.6 to run Symfony's test suite #48668 Migrate to static data providers #49253 Use TestCase suffix for abstract test cases @nicolasgrekas
  8. New syntax #48793 Leverage arrow function syntax for closure #48670

    Use ::class #48069 Use ??= more @nicolasgrekas
  9. - $this->class = get_class($object); + $this->class = $object::class; - $values

    = array_filter($values, function ($val) { return null !== $val; }); + $values = array_filter($values, fn ($val) => null !== $val); - if (null === $path) { - $path = '/'; - } + $path ??= '/'; @nicolasgrekas
  10. Continuous Integration #49001 Speed up Psalm tests (12 to 2

    minutes) #47180 Add ossf/scorecard GitHub action @nicolasgrekas
  11. 📅 🗺 🤝 🕸 New components #47112 Add a Scheduler

    component #50112 Add AssetMapper to manage JS deps without nodejs #48542 Add the RemoteEvent and Webhook @nicolasgrekas https://speakerdeck.com/fabpot/
  12. 🔔️ Notifier #47373 Add Chatwork bridge #46395 Add Contact Everyone

    bridge #46724 Add SMSFactor bridge #49454 Add Pushover bridge #49461 Add MailerSend bridge #48855 Add PagerDuty bridge #48101 Add Mastodon bridge #48466 Add Line bridge #48389 Add Bandwidth bridge #48394 Add Plivo bridge #48397 Add RingCentral bridge #48398 Add Termii bridge #48399 Add iSendPro bridge #48084 Add Twitter bridge @nicolasgrekas
  13. ⌚ Clock #48642 Add Clock class and now() function #48362

    Add ClockAwareTrait @nicolasgrekas use function Symfony\Component\Clock\now; $now = now(); // returns a DateTimeImmutable instance Clock::set(new MockClock()); // for testing
  14. 🕹️ Controllers #49358 Deprecate @route annotations in favor of attributes

    #48128 Add support for the 103 Early Hints and other 1XX #49134 Add #[MapQueryParameter] to map query parameters #49138 Add #[MapRequestBody] and #[MapQueryString] @nicolasgrekas
  15. @nicolasgrekas // Matches /blog?page=1 #[Route(path: '/blog', name: 'blog')] public function

    index( #[MapQueryParameter(options: ['min_range' => 0])] int $page = 0, ) { // ...
  16. @nicolasgrekas // Matches /blog?page=1 #[Route(path: '/blog', name: 'blog')] public function

    index( #[MapQueryParameter(options: ['min_range' => 1])] int $page = 0, ) { // ...
  17. @nicolasgrekas #[Route('/product-review', methods: ['POST'])] public function post( #[MapRequestPayload] ProductReviewDto $productReview,

    ) { // ... class ProductReviewDto { public function __construct( #[Assert\NotBlank] #[Assert\Length(min: 10, max: 500)] public readonly string $comment, #[Assert\GreaterThanOrEqual(1)] #[Assert\LessThanOrEqual(5)] public readonly int $rating, ) { // ...
  18. 🌽 HttpKernel #48352 #[WithHttpStatus] for defining status codes for exceptions

    #48747 #[WithLogLevel] for defining log levels for exceptions @nicolasgrekas #[WithHttpStatus(429, ['Retry-After' => 10])] #[WithLogLevel(LogLevel::INFO)] class RateLimitedException extends \Exception {
  19. 🌐 HttpClient @nicolasgrekas #49302 Add UriTemplateHttpClient to use RFC-6570 #49911

    Support mime/multipart file uploads #49809 Allow using multiple base_uri as array for retries #50274 Set the minimum TLS version to v1.2
  20. 🛡️ Security #48272 OpenID Connect Token Handler #49300 Add #[NoSuspiciousCharacters]

    to spot spoofing attempt #49789 New #[PasswordStrength] constraint #49306 Add logout configuration for Clear-Site-Data header @nicolasgrekas Clear-Site-Data: "cookies"
  21. 🧙‍♂️ Dependency Injection 1/2 #47680 Remove parameters starting with a

    dot when compiling #47719 Add ContainerBuilder::deprecateParameter() #49411 Add support for #[AsAlias] during auto-discovery @nicolasgrekas
  22. 🧙‍♀️ Dependency Injection 2/2 #46752 Generate lazy proxies out of

    the box #48484 Deprecate proxy-manager bridge #49685 Add support for #[Autowire(lazy: true)] #49628 Autowire services as closures with #[AutowireCallable] @nicolasgrekas
  23. @nicolasgrekas public function __construct( #[AutowireCallable(UriTemplate::class, 'expand')] UriExpanderInterface $expander, ) new

    class($uriTemplate->expand(...)) implements UriExpanderInterface { public function __construct( private \Closure $closure, ) { } public function expand(string $url, array $vars): string { return $this->closure->__invoke($url, $vars); } } $uriTemplate->expand(...)
  24. 🫶 Developer eXperience #47352 Remove profiles automatically after two days

    #48059 Auto-create Doctrine migrations for sessions and locks #48707 Fail if #[Target] attribute does not exist during compilation #48938 Allow setting private services with the test container #48432 Add support of named arguments to dd() and dump() @nicolasgrekas
  25. 🎁 Various Goodies #49614 Add Request::getPayload(): array #49913 [Twig] Add

    {{ app.locale }} #49529 Add support for better signal handling in commands #49588 Render date/time form types using HTML5 by default @nicolasgrekas
  26. symfony.com/ sponsor • Become a backer • Deploy on Platform.sh

    • Attend Symfony conferences • Get certified • Sign up for SymfonyInsight • Buy the Symfony book • Subscribe to SymfonyCasts @nicolasgrekas