Feature Proposal: Add a lateInitPlugin() handler for plugins

Motivation

Plugins are initialized in two steps, first calling earlyInitPlugin(), then initPlugin() but we are missing a lateInitPlugin(). This is required for plugins that have to wait until all other plugins have been initialized and then will require some final initialization steps.

The most prominent implementation will be a lateInitPlugin() in JQueryPlugin. It will iterate over all loaded jQuery modules and combine some of their assets into one (separate proposal). As most plugins either use LocalSite.cfg or initPlugin() to register their additional jQuery modules, will some of them not be registered yet in JQueryPlugin's initPlugin().

Description and Documentation

This will dispatch all lateInitPlugin handlers when plugins have been fully initialized. This change touches the files Foswiki::Plugin(s).pm.

We will have to increment the API version from 2.4 to 2.5 in distro and master branch. Master branch had its api already incremented to 2.5 for other reasons. This will then make room for 2.5 by moving its number from 2.5 to 2.6 (Foswiki::Request subtypes)

Impact

API
edit

Implementation

-- Contributors: MichaelDaum - 24 Oct 2023

Discussion

 
I Attachment Action Size Date Who Comment
LateInit.patchpatch LateInit.patch manage 1 K 27 Nov 2023 - 18:25 MichaelDaum patches to backport the feature to 2.1.8
ObfuscateZoneIDs.patchpatch ObfuscateZoneIDs.patch manage 1 K 27 Nov 2023 - 18:25 MichaelDaum patches to backport the feature to 2.1.8
Topic revision: r4 - 27 Nov 2023, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy