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

[DoctrineBridge] always load event listeners lazy via ServiceLocator#27675

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 1 commit intosymfony:masterfromdmaicher:issue-27661
Jun 28, 2018

Conversation

@dmaicher
Copy link
Contributor

@dmaicherdmaicher commentedJun 21, 2018
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?yes/no
Tests pass?yes
Fixed tickets#27661
LicenseMIT
Doc PRsymfony/symfony-docs#9973

As described in#27661 this PR suggests to always load doctrine event listeners lazily from a service locator instead of the full service container.

If we agree to move forward I could tackle the remaining todos:

  • update UPGRADE.md
  • documentation PR
  • tested on real app

@weaverryan
Copy link
Member

I really think there is no downside - this pattern is followed in many other places in Symfony. The lazy flag was added SO long ago, I think it was basically an old work around before we had the proper service locator solution.

I’d say, move forward with the deprecation and upgrade log stuff. Then we’ll probably need Nicolas to double check the implementation (it makes sense to me - but this is his area).

And thanks for making a PR - what an awesome surprise!

@chalasr
Copy link
Member

deprecation notice for thelazy attribute sounds good to me.

@dmaicher
Copy link
ContributorAuthor

@weaverryan@chalasr but technically I removed the usage of the flag already 😄 So is a deprecation still correct? It should say something likeThe "lazy" attribute was removed in Symfony 4.2. Listeners are now always lazy by default.?

Or should we keep using the flag and remove it completely in 5.0? Although I think it does not have any BC breaks. Unless someone is weirdly relying on the fact that a service is eagerly instantiated 😋

@chalasr
Copy link
Member

I think going always lazy now is fine, the deprecation notice would only allow people to remove a dead tag attribute, and stop being triggered in 5.0. Not sure we had a similar case in the past so having an additional opinion would be good

@nicolas-grekas
Copy link
Member

By not triggering any depreciation for the unused "lazy" attribute, we're making it easier for e.g. bundles to support several major versions, isn't it? So should stay as is then IMHO.

@dmaicher
Copy link
ContributorAuthor

@nicolas-grekas haha ok. I just added the deprecation 😄 But I can remove it again if needed. No problem.

@weaverryan
Copy link
Member

So, would we keep that lazy flag (after it does nothing) forever? You’re right about compat, but keeping it forever seems odd.

@nicolas-grekas
Copy link
Member

We should just ignore it.

@dmaicher
Copy link
ContributorAuthor

Documentation PR added, deprecation notice removed, tested with a real Symfony app.

Ready for a last round of reviews 😊

@fabpot
Copy link
Member

Thank you@dmaicher.

@fabpotfabpot merged commit130ec05 intosymfony:masterJun 28, 2018
fabpot added a commit that referenced this pull requestJun 28, 2018
…ServiceLocator (dmaicher)This PR was squashed before being merged into the 4.2-dev branch (closes#27675).Discussion----------[DoctrineBridge] always load event listeners lazy via ServiceLocator| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | yes/no| Tests pass?   | yes| Fixed tickets |#27661| License       | MIT| Doc PR        |symfony/symfony-docs#9973As described in#27661 this PR suggests to always load doctrine event listeners lazily from a service locator instead of the full service container.If we agree to move forward I could tackle the remaining todos:- [x] update UPGRADE.md- [x] documentation PR- [x] tested on real appCommits-------130ec05 [DoctrineBridge] always load event listeners lazy via ServiceLocator
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull requestJun 29, 2018
…Symfony 4.2 change (dmaicher, javiereguiluz)This PR was merged into the master branch.Discussion----------[DoctrineBridge] update doctrine event listeners doc for Symfony 4.2 changeSeesymfony/symfony#27675.Doctrine entity listeners are always lazily instantiated as of Symfony 4.2.Commits-------4409fd6 Explain that lazy listeners are mandatory, not defaultb56ef9e Update event_listeners_subscribers.rstd8bb849 Reworded and added the versionadded directive601450e Update event_listeners_subscribers.rst
@nicolas-grekasnicolas-grekas removed this from thenext milestoneNov 1, 2018
@nicolas-grekasnicolas-grekas added this to the4.2 milestoneNov 1, 2018
This was referencedNov 3, 2018
@dmaicherdmaicher deleted the issue-27661 branchNovember 30, 2018 14:13
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@chalasrchalasrchalasr approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

7 participants

@dmaicher@weaverryan@chalasr@nicolas-grekas@fabpot@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp