Skip to content

docs: state that installed extensions are not read - #19

Merged
kasperg merged 1 commit into
mainfrom
docs/installed-extensions
Oct 14, 2026
Merged

kasperg merged 1 commit into
mainfrom
docs/installed-extensions

Conversation

@kasperg

@kasperg kasperg commented Oct 14, 2026

Copy link
Copy Markdown
Member

The package never reads core.extension.yml, so a hook or plugin for a module the site does not install counts as used. The README did not say so.

This adds it to the limitations by design, with the reason: on the sites measured, such code was deleted together with the module, so detecting leftovers is not worth reading configuration and mapping each hook to the module that defines it.

The evidence is dpl-web's history up to 2026-10-02:

  • Of 20 removals from its core.extension.yml, nine were uninstalls. The rest were installed again or moved to config_exclude_modules.
  • Integration code went before or with every uninstall. address_dawa's formatter was removed in a refactor months before. The PR that uninstalled gsearch removed a formatter extending AddressGsearchFormatter, its interface uses and its config reads.
  • On develop, none of its 345 hook implementations, class references or event subscribers serve an uninstalled module. Only one-off update and deploy functions still name one.

Reading the list would also take more than parsing one file: hook owners come from core's and contrib's *.api.php outside the analysed paths, pattern hooks such as form_FORM_ID_alter need form IDs, theme hooks and entity types mapped to modules, and procedural hooks are functions, which dead-code-detector does not report.

Verified locally: make checks and make lint-commits pass.

A hook or plugin for a module the site does not install counts as used,
since the package never reads core.extension.yml. The README did not
say so.

Add it to the limitations by design, with the reason.

The reason is dpl-web's history up to 2026-10-02. Of 20 removals from
its core.extension.yml, nine were uninstalls; the rest were installed
again or moved to config_exclude_modules. Each time the integration
code went before or with the uninstall:

- address_dawa: its formatter was removed in a refactor months before.
- gsearch: the uninstalling PR removed a formatter extending
  AddressGsearchFormatter, its interface uses and its config reads.

On develop, only one-off update and deploy functions still name an
uninstalled module. None of its 345 hook implementations, class
references or event subscribers serve one.

Reading the list would also cost more than parsing one file:

- Hook owners come from core's and contrib's *.api.php files, outside
  the analysed paths.
- Pattern hooks such as form_FORM_ID_alter need form IDs, theme hooks
  and entity types mapped to modules; matching names gives false hits.
- Procedural hooks are functions, which dead-code-detector does not
  report.

Assisted-by: Claude <noreply@anthropic.com>
@kasperg
kasperg merged commit 6736585 into main Oct 14, 2026
15 checks passed
@kasperg
kasperg deleted the docs/installed-extensions branch October 28, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant