Conversation
Review Summary by QodoDocument plugin lazy loading support for PHP 8.4
WalkthroughsDescription• Added documentation for PHP 8.4 lazy objects support in plugins • Explains how to use $container->lazy() in service providers • Includes code example for lazy plugin instantiation • Documents performance improvement benefits for Joomla 6.1+ Diagramflowchart LR
A["Plugin Documentation"] -->|"Add lazy loading guide"| B["Service Provider Example"]
B -->|"Use container.lazy()"| C["Deferred Plugin Instantiation"]
C -->|"Improves Performance"| D["Joomla 6.1+"]
File Changes1. docs/building-extensions/plugins/basic-content-plugin.md
|
Code Review by Qodo
✅ 1.
|
|
thanks, I would prefer to rewrite all example usages, at the moment it looks like a "hey good to know" not like, "do it or you are the bad one" ;-)
Also I think it would be good to mentation that the code is compatible with joomla 6.0 (container lazy support) but really useful with 6.1. Also it's a complete description missing what, why, who it works. And what you need to consider (don't use the constructor for global effects), plugin object might not be create if event function is self contain and such things (subscriberinterface). |
I think for this it is need to review whole Manual then. |
|
maybe @robbiejackson can help and I think we don't have to many examples and a good plugin section. |
|
I was planning to have a lazy loading section in the Plugin Advanced Features page. I'm away on holiday for a bit over 3 weeks but could have a look at that when I get back, if no-one else does it. So I'm OK with this PR as it stands, and can address other stuff as part of a separate PR. I see it's using PHP 8.4. Is it agreed when 8.4 will be required as a prerequisite of Joomla? In 6.1? I wouldn't want to have examples which didn't work because of <8.4 version, if that version was not mandated by Joomla. |
|
The code is already in Joomla 6.0, if php is < 8.4 we fallback to the "old" behaviour (directly creating the object) so you can use the same code already for joomla 6.0 and/or php 8.3 but it doesn't have the same effect. And it's not "advanced" it's the new default. thanks for offering doing this, have a nice vacation. |
PR for: