-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[WIP] A new Asset Component #13143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] A new Asset Component #13143
Conversation
The service definition for the ActionsHelper and the AssetsHelper should be moved from templating_php.xml to templating.xml so that they are always loaded. Otherwise it is a BC break because the Twig extensions won't work anymore when the PHP engine is not enabled (and so cannot go in 2.7). And forcing to enable the PHP engine for these extensions to work is wrong. The fact that the Twig extension is implemented as a wrapper around the PHP helper is an implementation detail and should not force to slow down all engine calls because of the usage of the delegating engine to wrap both engines |
1de547b
to
09c42a9
Compare
…ines is not present
09c42a9
to
8143e01
Compare
@stof: I've made some progress. It's not finished yet and still work in progress (I did not bother with tests), but you can have a look at the direction I took: I've decided to create a new component for the Asset/ part of the Templating component; it makes sense as there is no dependency between the Asset classes and the rest of the templating component. I've also added a More to come. |
0ae51ca
to
4c28c2e
Compare
87e279c
to
78cc129
Compare
78cc129
to
a8c9b1b
Compare
… Symfony Full Stack
a8c9b1b
to
686bee6
Compare
…nsExtension (fabpot) This PR was merged into the 2.7 branch. Discussion ---------- [TwigBundle] removed the Container dependency on ActionsExtension | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | fixes #11876 partially | License | MIT | Doc PR | n/a This PR removes the injection of the container into the actions extension, and decouple this extension from FrameworkBundle (it was part of #13143 but as it is now totally independent, I've created a new PR). Commits ------- 76abf98 [TwigBundle] removed the Container dependency on ActionsExtension
…emplating.engines is not present (fabpot) This PR was merged into the 2.7 branch. Discussion ---------- [TwigBundle] always load the exception listener if the templating.engines is not present | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | fixes #11876 partially | License | MIT | Doc PR | n/a This PR removes (partially) the dependency of TwigBundle on FrameworkBundle. If FrameworkBundle is not registered, the Twig exception listener is always registered (this change was part of #13143 but as it is now totally independent, I've created a new PR). Commits ------- 30ba9df [TwigBundle] always load the exception listener if the templating.engines is not present
I'm going to split this PR to make it easier to review. |
This PR started as an attempt to fix #11748 and at the same time, trying to decouple things and prepare 3.0 where the PHP templating engine will probably be moved outside the core framework.
But as I tried to decouple things, I realize that the asset sub-system was totally coupled to the Templating component, coupled with HttpFoundation (and the request scope), and not really well designed to start with. So, in addition to the initial goal, this PR extracts the asset sub-system into a new component that is easy to reuse (should be possible now to use the Symfony
asset
Twig function in Silex for instance very easily).It's probably better to review this PR per commit.
THIS IS WORK IN PROGRESS AND THIS IS NOT FINISHED YET.