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

Embracing the Future with Symfony 7

Embracing the Future with Symfony 7

In the ever-evolving landscape of web development, staying ahead with robust and cutting-edge tools is paramount. Symfony 7, the latest iteration of the foundational PHP framework, continues to push the boundaries of efficiency, performance, and flexibility. This talk will dive into the core innovations that Symfony 7 brings to the table. We'll explore new features, enhancements, and integrations that make Symfony 7 a powerhouse for developers seeking to build scalable and sophisticated web applications.

Nicolas Grekas

January 26, 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. Backward Compatibility Promise • Upgrade every month for bug fixes

    • Upgrade every 6 months for features "require": { "php": ">=8.1" }
  3. Continuous Upgrade Path • Fix deprecations every 6 months •

    Upgrade every 2 years for new major "require": { "php": ">=8.2" }
  4. Symfony 7 • Remove deprecated code paths • Add native

    return types • Add native types to public|protected properties
  5. 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
  6. 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
  7. Performance #48802 Cut compilation time #49781 Improve perf. of translation

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

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

    ServiceProviderInterface<T> + */ class ServiceLocator implements ServiceProviderInterface, \Countable {
  10. Just Enjoy on your side #[AsEventListener] class MyRequestListener { public

    function __invoke(RequestEvent $event): void { // ... } }
  11. HttpKernel #48352 #[WithHttpStatus] for defining status codes for exceptions #48747

    #[WithLogLevel] for defining log levels for exceptions #[WithHttpStatus(429, ['Retry-After' => 10])] #[WithLogLevel(LogLevel::INFO)] class RateLimitedException extends \Exception {
  12. 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, ) { // ...