Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[TwigBridge] Support for Twig 3#33039
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
4bd824f to0ea6aabComparefabpot commentedAug 21, 2019
See#33269 |
fabpot commentedAug 21, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
…(fabpot)This PR was merged into the 4.4 branch.Discussion----------[TwigBridge] Mark all classes extending twig as@Final| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | yes-ish| New feature? | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets | refs#33039| License | MIT| Doc PR | n/aClasses defining extensions/nodes/node visitors/token parsers should not be changed. They should be final.That would also help with Twig 3.0 which introduces type hints (including return types).Commits-------d657459 [TwigBridge] Mark all classes extending twig as@Final
Uh oh!
There was an error while loading.Please reload this page.
derrabus commentedAug 21, 2019
Ready. Also, I'm wondering if we should backport the composer.json changes (except for the bridge, of course) to 4.4. An Symfony 4.4 application with TwigBridge 5.0 should technically be able to run Twig 3. |
fabpot commentedAug 21, 2019
Symfony 4.4 still supports 1.x, so it cannot support 1.x/2.x and 3.0 at the same time. |
81b4cf1 tob3b7570CompareThis PR was merged into the 4.4 branch.Discussion----------Removed calls to Twig\Environment::loadTemplate()| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | N/A| License | MIT| Doc PR | N/AThis PR prepares#33039. Twig 3 does not have the `loadTemplate()` anymore, so this PR replaces calls to that method.Commits-------ea9e375 Removed calls to Twig\Environment::loadTemplate().
fabpot commentedAug 21, 2019
I've just merged 4.4 into master so that this one can be rebased. |
nicolas-grekas commentedAug 21, 2019
We should also replace all |
derrabus commentedAug 21, 2019
Rebased. |
derrabus commentedAug 21, 2019
Done. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
derrabus commentedAug 21, 2019
Should I also remove the |
derrabus commentedAug 21, 2019
Also, I will add return type declarations to all |
fabpot commentedAug 21, 2019
|
derrabus commentedAug 21, 2019
Ready. |
fabpot commentedAug 21, 2019
Thank you@derrabus. |
This PR was squashed before being merged into the 5.0-dev branch (closes#33039).Discussion----------[TwigBridge] Support for Twig 3| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | yes| Deprecations? | no| Tests pass? | yes| Fixed tickets | N/A| License | MIT| Doc PR | N/AI occasionally test my projects against dev branches of the libraries I use. It's probably a bit early for this PR, but since I had to patch Symfony anyway in order to test Twig 3 in my projects, I though I might as well share the branch with you.BC break: I had to add return types to several non-final classes of the Twig bridge. This will break applications that override these classes without adding the return types.This PR is marked as a draft because Twig 3 is still a moving target.Commits-------44ed90c Finalized all `@final` classes.f30edca Support for Twig 3.
Uh oh!
There was an error while loading.Please reload this page.
I occasionally test my projects against dev branches of the libraries I use. It's probably a bit early for this PR, but since I had to patch Symfony anyway in order to test Twig 3 in my projects, I though I might as well share the branch with you.
BC break: I had to add return types to several non-final classes of the Twig bridge. This will break applications that override these classes without adding the return types.
This PR is marked as a draft because Twig 3 is still a moving target.