Typo3 webcomponents

From dirnbauer/webconsulting-skills · View interactive version

Typo3 webcomponents is an AI agent skill from the GitHub repository dirnbauer/webconsulting-skills. Build, review, or migrate TYPO3 v14 backend Web Components with Lit, ES module import maps, AssetCollector/f:asset.module, backend modules, FormEngine/Form Editor integrations, AJAX routes, and reusable TYPO3 backend components. Use whenever the user mentions TYPO3 backend JavaScript, Web Components

How to use this skill

Skill file

TYPO3 Web Components

Source: https://github.com/dirnbauer/webconsulting-skills

Use this skill for TYPO3 v14 backend programming with standards-based Web Components and Lit. Treat v14 as the only compatibility target: do not add TYPO3 12/13 fallbacks unless the user explicitly asks for a migration note, and verify current v14 APIs in the official TYPO3 docs before implementing.

This skill was created from the Anthropic-style skill-creator workflow and follows progressive disclosure: keep the top-level workflow short, then read the focused references when code or review depth is needed.

Related Local Skills

Use these nearby TYPO3 skills together when the task touches their domain:

Concepts

Web Components are browser standards for custom reusable HTML elements. The usual building blocks are Custom Elements, Shadow DOM, and templates/slots. A component can appear in markup like <vendor-status-card></vendor-status-card> and the browser connects it to a JavaScript class.

TYPO3 backend Web Components are custom elements used inside the authenticated TYPO3 backend. TYPO3 v14 uses ES modules, import maps, @typo3/* module identifiers, backend module configuration, FormEngine/Form Editor JavaScript, and Lit-based components for parts of the backend UI. The right model is "small interactive backend UI islands", not a separate SPA unless the backend feature genuinely needs one.

Lit is a small library on top of Web Components. In the TYPO3 backend, prefer Lit when the element has reactive state, templated rendering, repeated DOM updates, slots, or a reusable public API. Use plain vanilla JavaScript for tiny one-off behavior where a custom element would be ceremony.

Frontend Decision

Answer frontend questions precisely:

Default Workflow

  1. Confirm the task is TYPO3 v14 backend work. If it is frontend work, apply the frontend decision above and use typo3-vite when bundling is needed.
  2. Inspect the extension shape before coding: Configuration/JavaScriptModules.php, Resources/Public/JavaScript, backend module controllers, Fluid templates, Configuration/Backend/Modules.php, Configuration/Backend/AjaxRoutes.php, and Form Framework YAML if relevant.
  3. Prefer existing TYPO3 backend APIs and components before writing new components. Search current sources for @customElement( and verify whether a component is meant to be reused.
  4. Choose the smallest viable rendering path:
  1. Register ES module imports in Configuration/JavaScriptModules.php. Use absolute import-map identifiers such as @vendor/my-extension/backend/status-card.js; avoid relative imports in TYPO3-loaded modules.
  2. Load modules through PageRenderer->loadJavaScriptModule() in controllers or <f:asset.module identifier="..."/> in Fluid. Do not add inline scripts for backend component bootstrapping.
  3. Pass small scalar configuration via attributes. For larger or privileged data, generate a backend route URL in PHP and let the component fetch it with @typo3/core/ajax/ajax-request.js.
  4. Keep backend writes server-side and permission-checked. Use DataHandler for TCA-managed records and configure inheritAccessFromModule on related AJAX routes.
  5. Validate UX with a real backend user, not only admin. Check keyboard access, focus behavior, reduced-motion tolerance, loading/error/empty states, and permissions.

References

Read references/examples-and-howtos.md when implementing code. It includes import maps, Lit components, Fluid loading, AJAX routes, Form Editor modernization, and reusable component examples.

Read references/checklists.md when reviewing or migrating code. It includes dos and donts, speed guidance, security/accessibility checks, source links, and the related-skill comparison.

Speed Notice

Lit is fast and small, but it does not make inefficient code fast. Keep render() pure and cheap; compute expensive derived data outside render, debounce high-frequency input, replace arrays/objects instead of mutating them in place, abort stale fetches, cache server results where appropriate, and lazy-load backend modules only on pages that need them.

In TYPO3 v14 frontend asset concatenation/compression was removed from Core, so frontend production assets need an external build tool. Backend ES modules are import-mapped and loaded on demand; still avoid shipping large backend bundles to every module.

Source Baseline

Use these sources when refreshing facts:

Special thanks to ochorocho for the Camp Vienna material and lit_demo examples that informed the practical TYPO3 backend Lit patterns in this skill.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.