Symfony 4.3 curated new features

Symfony 4.3.0 is going to be released in a few days. As for any other Symfony minor release, our backward compatibility promise applies and this means that you should be able to upgrade easily without changing anything in your code.

We've already blogged about the great 4.3 new features, but here is a curated list of the most relevant changes (this version has a total of 270 new small and big features):

New Components

  • HttpClient provides powerful methods to fetch HTTP resources synchronously or asynchronously (nicolas-grekas) #30413
  • Mailer helps sending emails (fabpot) #30741
  • Mime allows manipulating MIME messages (fabpot) #30416 and #29896

The new HttpClient, Mailer, and Mime components are marked as experimental in 4.3.

The Inflector component is not internal anymore.

Not really new components, but Contracts are now split and available on their own: Cache, EventDispatcher, HttpClient, Service, and Translation.

Messenger

The messenger component is still marked as experimental in 4.3.

  • Add a redis stream transport (soyuka, alexander-schranz) #30917
  • Add a Doctrine transport (vincenttouzet) #29007
  • Add a "in-memory://" transport (GaryPEGEOT, sroze) #29097
  • Add a messenger:stop-workers command (weaverryan) #30754
  • Add a command to setup transports (vincenttouzet) #29476
  • Add a "sync" transport to call handlers synchronously (weaverryan) #30759
  • Add failure transport support (weaverryan) #30970
  • Introducing native php serialize() support for Messenger transport (weaverryan, xabbuh) #29958
  • Use an AmqpStamp to provide flags and attributes (sroze) #30913
  • Add a stamp to provide a routing key on message publishing (G15N, sroze) #30008
  • Add MessageCountAwareInterface to get transport message count (weaverryan) #30757
  • Add WorkerStoppedEvent (chalasr) #31282
  • Allow to register handlers on a specific transport (sroze) #30958
  • Deprecate LoggingMiddleware in favor of providing a logger to SendMessageMiddleware (nicolas-grekas) #30539
  • Add transport agnostic exception (nikossvnk, lolmx) #30375
  • Make the serializer configurable by transport (weaverryan) #30628

Security

  • Dispatch an event when "logout user on change" steps in (Simperfit) #31138
  • Deprecate BCryptPasswordEncoder in favor of NativePasswordEncoder (nicolas-grekas) #31170
  • Add NativePasswordEncoder (nicolas-grekas) #31140
  • Replace Argon2*PasswordEncoder by SodiumPasswordEncoder (chalasr) #31019
  • Add Argon2idPasswordEncoder (chalasr) #30968
  • Deprecate the Role and SwitchUserRole classes (xabbuh) #22048
  • Replace serialization API (renanbr) #30052

Intl

  • Add Timezones (ro0NL) #28831
  • Simplify API (ro0NL) #28846
  • Made countries ISO 3166 compliant (ro0NL) #31365
  • Rename Regions to Countries (ro0NL) #31350
  • Add timezone offset utilities (ro0NL) #31295

Validator

  • Add a NotCompromisedPassword password validator (dunglas) #27738
  • Automatic data validation (dunglas) #27735
  • Add new JSON validator (zairigimad) #28477
  • Add new Timezone validation constraint (phansys) #30900
  • Allow intl timezones (ro0NL) #31292
  • Add number constraints (jschaedl) #28637
  • Add constraint on unique elements collection(AssertUnique) (zenmate, nicolas-grekas) #26555
  • Add MIR card scheme (antonch1989) #30377
  • Add support for UATP card validation (raulfraile) #29504
  • NotBlank: add a new option to allow null values (dunglas) #29641
  • Check a BIC along with an IBAN (sylfabre) #28479

Workflow

  • Add support for many inital places (lyrixx) #30468
  • Add a context to Workflow::apply() (lyrixx) #29146
  • Add colors to workflow dumps (alexislefebvre) #29538
  • The TransitionEvent is able to modify the context (lyrixx) #30902
  • Added workflow_transition_blockers twig function (lyrixx) #30908
  • Changed initial_places to initial_marking, added property (HeahDude, lyrixx) #30890
  • Trigger entered event for subject entering in the Workflow for the first time (lyrixx) #29145

Translator

  • Add support for PHP files with trans() in translation commands (yceruto) #30120
  • Set sources when extracting strings from php files (Stadly) #31249
  • Add sources when dumping qt files (Stadly) #31248
  • Add comments when dumping po files (deguif) #30909
  • Add XLIFF 1 source to metadata to differentiate from attr (ostrolucky) #30472
  • Enable translation filters (ro0NL) #29286
  • Add support for Translator paths, Twig paths and Translator aware services paths in commands** (yceruto) #29121
  • Load original file metadata when loading Xliff 1.2 files (eternoendless) #29148

Serializer

  • Add datetimezone normalizer (jewome62) #30915
  • CsvEncoder no header option (encode / decode) (redecs) #29283
  • provide new ObjectPropertyListExtractorInterface (dmaicher) #30904

DomCrawler

  • Optionally use html5-php to parse HTML (tgalopin) #29306
  • Return empty string on Crawler::text() and Crawler::html() instead of an exception (respinoza) #28581
  • Added return of element name in extract() method (andrey-helldar) #29127

Console

  • Add dumper (ro0NL) #28898
  • Added suggestions for missing packages (przemyslaw-bogusz) #29865
  • Add callback support to ConsoleQuestion autocompleter (Mikkel Paulson) #30997
  • Add an iterate method to the ProgressBar class (jvasseur) #29753
  • Add hyperlinks support (ostrolucky) #29168

VarDumper

  • Add caster for WeakReference instances of PHP 7.4 (nicolas-grekas) #31130
  • Add link to source next to class names (nicolas-grekas) #30301
  • Add caster for OpenSSL X.509 resources (nicolas-grekas) #29821
  • Use hyperlinks in CliDescriptor (ogizanagi) #29613
  • Add support for links in CliDumper (nicolas-grekas) #29235

HttpKernel

  • Add RealHttpKernel: handle requests with HttpClientInterface (fabpot) #30625
  • Prevent search engines from indexing dev applications (GaryPEGEOT) #30325
  • Add a "short" trace header format for HttpCache, make header configurable (mpdude) #30964

DependencyInjection

  • Add a "require" env var processor (mpdude) #30897
  • Add a "trim" env processor (ogizanagi) #29781
  • Add a "default" env processor (jderusse) #28976
  • Replace "nullable" env processor by improving the "default" one (nicolas-grekas) #30504
  • Add support for "wither" methods - for greater immutable services (nicolas-grekas) #30212
  • ServiceProviderInterface, implementation for ServiceLocator (kejwmen) #25707
  • Deprecate non-string default envs (ro0NL) #27808
  • Add an url EnvProcessor (jderusse) #28975
  • Add ReverseContainer: a locator that turns services back to their ids (nicolas-grekas) #30334
  • Add support for deprecating aliases (j92, Renan) #29968
  • Invokable Factory Services (zanbaldwin) #30255
  • Add information about deprecated aliases in debug:autowiring (XuruDragon) #30075

Form

  • Add row_attr to form theme (alexander-schranz) #30320
  • Add help_html (mpiot) #29861
  • Add label_translation_parameters, help_translation_parameters and attr_translation_parameters options to base form type (webnet-fr) #28635
  • Add block prefix to csrf token field (alexander-schranz) #29862
  • Allow setting label attributes declared in label_attr (AngelFQC) #31220
  • Add intl/choice_translation_locale option to TimezoneType (ro0NL) #31294
  • Keep preferred choices order in ChoiceType (vudaltsov) #30985
  • Remove default option grouping in TimezoneType (ro0NL) #31293
  • Add intltimezone input to TimezoneType (ro0NL) #31195
  • Add file links for described classes in debug:form command (yceruto) #30826
  • Show all option normalizers on debug:form command (yceruto) #31082
  • TransformationFailedException: Support specifying message to display (ogizanagi) #20978
  • Allow to disable and customize PercentType symbol (Ken Stanley, OskarStark) #30433
  • Be able to specify the input format for times (xabbuh) #30358
  • Deprecate custom formats with HTML5 widgets (xabbuh) #28723
  • Add option to render NumberType as type="number" (xabbuh) #30267
  • Add input_format option to DateType and DateTimeType (fancyweb) #29887
  • Add a convenience method to get the parent form in Twig templates (xabbuh) #28812
  • deprecate some options for single_text widgets (xabbuh) #28721
  • Add new block_prefix option for an easy form theming (yceruto) #29680
  • Add "input" option to NumberType (fancyweb, Bernhard Schussek) #30893

Routing

  • Expose "utf8" option, defaults "locale" and "format" in configuration (Jules Pietri) #30508
  • Do not encode comma in query and fragment (Tobion) #31134
  • Allow invokable route loader services (fancyweb) #30933
  • UrlHelper to get absolute URL for a path (vudaltsov) #30862
  • Allow boolean container parameters for routes (dmaicher) #30379
  • allow using compiled matchers and generators without dumping PHP code (nicolas-grekas) #28865
  • Allow force-generation of trailing parameters using eg "/exports/news.{!_format}" (zavulon) #29599

Inflector

  • Remove "internal" marker from the component (nicolas-grekas) #30810
  • Support pluralization in the inflector (mbabker) #26890

Cache

  • Deprecate all PSR-16 adapters, provide Psr16Cache instead (nicolas-grekas) #29236
  • Add optimized FileSystem & Redis TagAware Adapters (andrerom) #30370
  • Add command for list all available cache pools (Nyholm) #31021
  • Add DSN support for rediss in AbstractAdapter and RedisTrait (alex-vasilchenko-md) #30605

Miscellaneous

  • [FrameworkBundle] Deprecate the Templating component integration (dunglas, fabpot) #21035
  • New PHPUnit assertions for the WebTestCase (Pierstoval, fabpot) #30813
  • [BrowserKit] Add support for HttpClient (fabpot, THERAGE Kévin) #30602
  • [BrowserKit] Rename Client to Browser (fabpot) #30541
  • [Lock] Added MongoDBStore (Joe Bennett) #27648
  • [Lock] Use env variable to create anytype of lock store (jderusse) #30935
  • [Dotenv] Deprecate useage of "putenv" (Nyholm) #31062
  • [TwigBridge] Add template file link to debug:twig command (yceruto) #30827
  • [Config] Deprecate TreeBuilder::root (gharlan) #31027
  • [MonologBridge] Add monolog processors adding route and command info (trakos) #28330
  • [MonologBridge] Disable DebugLogger in CLI (lyrixx) #30339
  • [WebProfilerBundle] Add Pretty Print functionality for Request Content (SamFleming) #28919
  • [WebProfilerBundle] Render the performance graph with SVG (Tom32i) #30450
  • [OptionsResolver] Add a new method addNormalizer and normalization hierarchy (yceruto) #30371
  • [Ldap] Implement pagination (kevans91) #29495
  • [Ldap] Entry move support (kevans91) #29448
  • [Finder] Throw a dedicated exception for non-existing directory (xelan) #30744
  • [Finder] Ignore paths from .gitignore #26714 (amaabdou) #30448
  • [EventDispatcher] swap arguments of dispatch() to allow registering events by FQCN (nicolas-grekas) #28920
  • [Debug] Mimic __toString php behavior in FlattenException (Deltachaos) #28879
  • [Debug] Display more details in the simple error page of Debug (javiereguiluz) #30024
  • [PropertyInfo] Add possibility to extract private and protected properties in reflection extractor (joelwurtz) #30706
  • [Filesystem] Support resources and deprecate using arrays in dumpFile() and appendToFile() (thewilkybarkid) #29661

Comments

A really impressive list. Thanks all!
Aren't the http-client, mime and mailer components experimental in 4.3?
A lot of cool features, thanks!
@Fabien Right, just added a note about that.
super excited for the http client, and the mailer can't wait to use them in my project
I'm wondering if https://github.com/symfony/symfony/issues/31653 is a BC break? WDYT?
Thank you very much for this great work, is almost perfect, it is a taste to use Symfony.

Note:
You need to mention this in the routes https://symfony.com/blog/new-in-symfony-4-3-routing-improvements#deprecated-some-router-options.
Which I don't understand because I think a lot of people use this for their dynamic route system.
This is the best release ever. So many great additions... Thank you!!!
Very happy and proud to contribute with this release, bud little sad to not see my name in the list.
Great List :) , Thank you !

Comments are closed.

To ensure that comments stay relevant, they are closed for old posts.