8a2a69f332
This PR was merged into the 5.1-dev branch.
Discussion
----------
[HttpKernel] allow cache warmers to add to the list of preloaded classes and files
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | yes
| Tickets | -
| License | MIT
| Doc PR | -
This PR makes cache warmers responsible for returning a list of classes or files to preload. It does so by adding the following to `WarmableInterface::warmUp()`:
`@return string[] A list of classes or files to preload on PHP 7.4+`
Of course, this return value is properly implemented so that we can see what this provides in practice. Here are the benchmarks on a simple Hello World rendered with Twig:
- without preloading: 360 req/s
- with preloading in master: 560 req/s (+55%)
- with preloading and this PR: 630 req/s (+75%)
Commits
-------
8ab75d99d4
[HttpKernel] allow cache warmers to add to the list of preloaded classes and files
4.9 KiB
4.9 KiB
UPGRADE FROM 5.0 to 5.1
Config
- The signature of method
NodeDefinition::setDeprecated()
has been updated toNodeDefinition::setDeprecation(string $package, string $version, string $message)
. - The signature of method
BaseNode::setDeprecated()
has been updated toBaseNode::setDeprecation(string $package, string $version, string $message)
. - Passing a null message to
BaseNode::setDeprecated()
to un-deprecate a node is deprecated
Console
Command::setHidden()
is final since Symfony 5.1
DependencyInjection
- The signature of method
Definition::setDeprecated()
has been updated toDefinition::setDeprecation(string $package, string $version, string $message)
. - The signature of method
Alias::setDeprecated()
has been updated toAlias::setDeprecation(string $package, string $version, string $message)
. - The signature of method
DeprecateTrait::deprecate()
has been updated toDeprecateTrait::deprecation(string $package, string $version, string $message)
. - Deprecated the
Psr\Container\ContainerInterface
andSymfony\Component\DependencyInjection\ContainerInterface
aliases of theservice_container
service, configure them explicitly instead.
Dotenv
- Deprecated passing
$usePutenv
argument to Dotenv's constructor, useDotenv::usePutenv()
instead.
EventDispatcher
- Deprecated
LegacyEventDispatcherProxy
. Use the event dispatcher without the proxy.
Form
- Implementing the
FormConfigInterface
without implementing thegetIsEmptyCallback()
method is deprecated. The method will be added to the interface in 6.0. - Implementing the
FormConfigBuilderInterface
without implementing thesetIsEmptyCallback()
method is deprecated. The method will be added to the interface in 6.0. - Added argument
callable|null $filter
toChoiceListFactoryInterface::createListFromChoices()
andcreateListFromLoader()
- not defining them is deprecated.
FrameworkBundle
- Deprecated passing a
RouteCollectionBuilder
toMicroKernelTrait::configureRoutes()
, type-hintRoutingConfigurator
instead - Deprecated not setting the "framework.router.utf8" configuration option as it will default to
true
in Symfony 6.0 - Deprecated
session.attribute_bag
service andsession.flash_bag
service.
HttpFoundation
- Deprecate
Response::create()
,JsonResponse::create()
,RedirectResponse::create()
, andStreamedResponse::create()
methods (use__construct()
instead) - Made the Mime component an optional dependency
HttpKernel
- Made
WarmableInterface::warmUp()
return a list of classes or files to preload on PHP 7.4+ not returning an array is deprecated - Deprecated support for
service:action
syntax to reference controllers. UseserviceOrFqcn::method
instead.
Mailer
- Deprecated passing Mailgun headers without their "h:" prefix.
Messenger
- Deprecated AmqpExt transport. It has moved to a separate package. Run
composer require symfony/amqp-messenger
to use the new classes. - Deprecated Doctrine transport. It has moved to a separate package. Run
composer require symfony/doctrine-messenger
to use the new classes. - Deprecated RedisExt transport. It has moved to a separate package. Run
composer require symfony/redis-messenger
to use the new classes. - Deprecated use of invalid options in Redis and AMQP connections.
- Deprecated not declaring a
\Throwable
argument inRetryStrategyInterface::isRetryable()
- Deprecated not declaring a
\Throwable
argument inRetryStrategyInterface::getWaitingTime()
Notifier
- [BC BREAK] The
ChatMessage::fromNotification()
method's$recipient
and$transport
arguments were removed. - [BC BREAK] The
EmailMessage::fromNotification()
andSmsMessage::fromNotification()
methods'$transport
argument was removed.
PhpUnitBridge
- Deprecated the
@expectedDeprecation
annotation, use theExpectDeprecationTrait::expectDeprecation()
method instead.
Routing
- Deprecated
RouteCollectionBuilder
in favor ofRoutingConfigurator
. - Added argument
$priority
toRouteCollection::add()
- Deprecated the
RouteCompiler::REGEX_DELIMITER
constant
Security
-
Deprecated
ROLE_PREVIOUS_ADMIN
role in favor ofIS_IMPERSONATOR
attribute.before
{% if is_granted('ROLE_PREVIOUS_ADMIN') %} <a href="">Exit impersonation</a> {% endif %}
after
{% if is_granted('IS_IMPERSONATOR') %} <a href="">Exit impersonation</a> {% endif %}
-
Deprecated
LogoutSuccessHandlerInterface
andLogoutHandlerInterface
, register a listener on theLogoutEvent
event instead. -
Deprecated
DefaultLogoutSuccessHandler
in favor ofDefaultLogoutListener
.
Yaml
- Deprecated using the
!php/object
and!php/const
tags without a value.