Skip to content

Commit c36a762

Browse files
committed
docs(handlers): recommend starting tagName with the app id
Like the files sidebar tabs. The library cannot check it, so it is a recommendation rather than a rule. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
1 parent 6609667 commit c36a762

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,9 @@ The full handler shape (see the `IHandler` interface):
336336
Gotchas:
337337

338338
- `tagName` must be lowercase, contain a hyphen, and have no leading, trailing
339-
or consecutive hyphens (e.g. `my-app-viewer`). An invalid one throws.
339+
or consecutive hyphens (e.g. `my-app-viewer`). An invalid one throws. Start
340+
it with your app id: custom elements share one registry for the whole page,
341+
and a name another app already defined is not yours to render.
340342
- `id` must be unique **across every app on the page**, not just your own:
341343
it is not namespaced for you. A collision does not throw: the second
342344
registration is silently dropped with a console warning, so pick something

‎lib/handlers.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ export interface IHandler {
3535

3636
/**
3737
* The custom element tag name to use for this handler.
38+
*
39+
* Custom elements share one registry for the whole page, so start it
40+
* with your app id, e.g. `myapp-note-view` for the app `myapp`.
3841
*/
3942
tagName: string
4043

0 commit comments

Comments
 (0)