Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
fabpot merged 2 commits intosymfony:masterfromderrabus:improvement/twig-3
Aug 21, 2019

Conversation

@derrabus
Copy link
Member

@derrabusderrabus commentedAug 8, 2019
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?yes
Deprecations?no
Tests pass?yes
Fixed ticketsN/A
LicenseMIT
Doc PRN/A

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.

kaznovac, andreybolonin, and sstok reacted with thumbs up emojikaznovac, andreybolonin, and sstok reacted with rocket emoji
@fabpot
Copy link
Member

See#33269

@fabpot
Copy link
Member

fabpot commentedAug 21, 2019
edited
Loading

Now that#33269 has been merged, I think we can finish this one@derrabus. Twig 3.0 will be releasedbefore Symfony 5, so this is safe and will allow us to spot issues sooner than later. Thank you.

sstok and andreybolonin reacted with hooray emoji

fabpot added a commit that referenced this pull requestAug 21, 2019
…(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
@derrabusderrabus marked this pull request as ready for reviewAugust 21, 2019 08:48
@derrabus
Copy link
MemberAuthor

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
Copy link
Member

Symfony 4.4 still supports 1.x, so it cannot support 1.x/2.x and 3.0 at the same time.

@derrabusderrabusforce-pushed theimprovement/twig-3 branch 2 times, most recently from81b4cf1 tob3b7570CompareAugust 21, 2019 11:46
fabpot added a commit that referenced this pull requestAug 21, 2019
This 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
Copy link
Member

I've just merged 4.4 into master so that this one can be rebased.

@nicolas-grekas
Copy link
Member

We should also replace all@final since Symfony 4.4 by@final here.

@derrabus
Copy link
MemberAuthor

Rebased.

@derrabus
Copy link
MemberAuthor

We should also replace all@final since Symfony 4.4 by@final here.

Done.

@derrabus
Copy link
MemberAuthor

Should I also remove thegetName() implementations from the Twig extensions? IIRC, we only need them for Twig 1 which has been dropped on master. Do we use them for anything else?

@derrabus
Copy link
MemberAuthor

Also, I will add return type declarations to all@finalclasses where possible.

@fabpot
Copy link
Member

getName() can be removed

derrabus reacted with thumbs up emoji

@derrabus
Copy link
MemberAuthor

Ready.

@fabpot
Copy link
Member

Thank you@derrabus.

fabpot added a commit that referenced this pull requestAug 21, 2019
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.
@fabpotfabpot merged commit44ed90c intosymfony:masterAug 21, 2019
@derrabusderrabus deleted the improvement/twig-3 branchAugust 21, 2019 14:42
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@stofstofstof left review comments

@fabpotfabpotfabpot approved these changes

@lyrixxlyrixxAwaiting requested review from lyrixx

@xabbuhxabbuhAwaiting requested review from xabbuh

Assignees

No one assigned

Projects

None yet

Milestone

5.0

Development

Successfully merging this pull request may close these issues.

6 participants

@derrabus@fabpot@nicolas-grekas@stof@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp