AssetView final class
Minn\Runtime\AssetView · public/minn/src/Minn/Runtime/AssetView.php · 101 lines
A registry's view in the shape plugins read and edit it: the public arrays of WordPress's dependency classes ($wp_scripts->registered, ->queue, ->done), kept current from Runtime\Assets one handle at a time. What a plugin edits in the view is handed back (Runtime\AssetEdits) before the registry changes or reads that handle, and for every handle before the view is rebuilt or printed from. Rebuilding the whole view at each change cost a page that registers hundreds of handles tens of milliseconds.
Constants and properties
| private | array $synced | |
| private | array $syncedLists | |
| private | bool $reconciling | |
| private | readonly Minn\Runtime\Assets $assets | Promoted from the constructor. |
| private | readonly object $owner | Promoted from the constructor. |
Public
Internals 5
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | refresh(?string $handle): void# | One handle of the view (none: null), the queue and the printed list, kept current after the registry changed them. |
| private | show(string $handle): void# | A handle as the registry holds it, in the view and remembered as shown; gone from both when the registry has none. |
| private | showLists(): void# | |
| private | handBack(?string $handle): void# | Hands back what a plugin edited in place for one handle (none: null), and in the queue and the printed list. |
| private | reconcile(?string $handle): void# | What a plugin did to the view's handles directly, for one handle or (null) every one, handed to the registry. |
Nothing matches.