Drop AbstractView::initDefaultApp and App::init methods#1968
Merged
Drop AbstractView::initDefaultApp and App::init methods#1968
Conversation
b531f60 to
23a9ce7
Compare
7899ee3 to
dbae15d
Compare
dbae15d to
6878438
Compare
8937e1e to
71d8fbf
Compare
mvorisek
commented
Jan 13, 2023
| $item = Factory::factory([View::class], ['name' => false, 'ui' => 'item', 'content' => $item]); | ||
| } | ||
|
|
||
| $item->setApp($this->getApp()); |
Member
Author
There was a problem hiding this comment.
in theory, app can be already set if an object with an app preset is passed
Contributor
|
@mvorisek Using invokeInit heavily, how can I set app manually? My central app class is set using $app = new App and then $app->invokeInit() is called, as around 50 models require App Scope right away. What is the recommended solution for this BC-break? |
Member
Author
|
there should be no or minimal BC break if you use App in Models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creating many implicit apps can imply negative performance and/or unexpected (other than configured, like implicit UI persistence comma) behaviour, both hard to debug.
If you call
View::invokeInit()manually (not recommended, but needed for edge cases), then you need to set the app manually before the call.This PR also asserts app is set no later than in init, this requirement may be drop in the future, but currently it is needed to load a template which is defined in almost every View.
Also drop
ExecutorFactory::create()method in favor ofExecutorFactory::createExecutor().