Skip to content

fix: never discover a plugin's dependency, build or asset directories - #372

Merged
ogorzalka merged 3 commits into
developfrom
fix/plugin-discovery-legitimate-directories
Sep 30, 2026
Merged

ogorzalka merged 3 commits into
developfrom
fix/plugin-discovery-legitimate-directories

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

Problem

A plugin with neither app/ nor src/ was discovered from its root. That is the shape of a plugin that only ships blocks — blocks are registered by convention and need no class — and such a plugin has node_modules/ at its root as soon as it has a Vite build.

Measured on pollora-test (pollora-blocks-demo, blocks in resources/views/blocks, no app/): every request logged Pollora discovery scanned …/pollora-blocks-demo in 2168–6985ms, front page at 3–8 s.

Change

PluginRegistrar::getPluginDiscoveryPaths() (was getPluginDiscoveryPath()):

  • app/, else src/ — unchanged;
  • otherwise the plugin's other top-level directories, never node_modules, vendor, bower_components, build, dist, public, resources, assets, languages, lang or a hidden directory. A plugin with classes in e.g. includes/ is still discovered; a blocks-only plugin is not scanned at all.

Tests

  • PluginDiscoveryPathTest: other top-level directories scanned; none of the excluded ones ever returned.
  • On pollora-test, same plugin without app/: front page 0.55–0.68 s, no slow-scan warning, pollora-blocks-demo/accordion still registered.
  • Full suite serial 1368 green. (The one parallel-only failure is the flaky slow-scan test fixed in test: warm up discovery before timing an empty scan #371.)

A plugin with neither app/ nor src/ was scanned from its root, node_modules included:
2 to 7 s per request in debug mode on a blocks-only plugin with a Vite build.
@ogorzalka
ogorzalka merged commit 02280ac into develop Sep 30, 2026
11 checks passed
@ogorzalka
ogorzalka deleted the fix/plugin-discovery-legitimate-directories branch September 30, 2026 11:45
@ogorzalka ogorzalka mentioned this pull request Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant