frontend-app-api: restrict the ability for plugins to override APIs

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2026-01-15 23:10:54 +01:00
parent d15524f895
commit 3bd2a1a5bf
10 changed files with 223 additions and 48 deletions
@@ -53,7 +53,15 @@ class ApiRefImpl<T> implements ApiRef<T> {
}
/**
* Creates a reference to an API.
* Creates a reference to an API. The provided `id` is a stable identifier for
* the API implementation.
*
* @remarks
*
* The frontend system infers the owning plugin for an API from the `id`. The
* recommended pattern is `plugin.<plugin-id>.*` (for example,
* `plugin.catalog.entity-presentation`). This ensures that other plugins can't
* mistakenly override your API implementation.
*
* @param config - The descriptor of the API to reference.
* @returns An API reference.