Plugin lifecycle & onRun ()?

Not sure, what and when was changed, but Plugin.php method onRun was not called and currently not sure, why. Some info are welcome… thanks.

I am guessing here, but it might be when using an AJAX partial.

The ajaxPartial tag will trigger a new lifecycle, called the capture lifecycle. It could mean onRun may get called.

When calling an AJAX handler from inside an AJAX partial, a capturing page life cycle is triggered that enables the use of AJAX handlers within the requested partials.

The capture life cycle renders the entire page, but it renders into the void. This way, we can initialize the page, including all the used partials and AJAX handlers.

using a onRun method inside Plugin.php file has nothing to do with ajaxPartial, i guess. i found an solution to bind event listenner to beforeDisplay, what is probably better.

1 Like

This loading by ajaxPartial with lazy ends up going through the entire page cycle, as if the page had been loaded again, if I use it 3 or 4 times, there are 3 or 4 pages loading again, it becomes very heavy and costly. Wouldn’t there be a way to just call component::partial and just have it load?

I don’t know if I expressed myself well.

The lazy needs to be improved to consolidate multiple calls on the same page into one request. That will reduce the cost.

I’m not sure about it triggering the capture lifecycle, I don’t think it should since that is only needed to register AJAX handlers and components. We will review this too and make sure there is a way to disable it.