Single Directory Components in Core: A Modern Approach to Drupal’s Front-end
summary
Drupal core adds Single Directory Components in 10.1 so a component’s template, CSS, JS and metadata live together and are auto‑loaded; a demo converts node--session teaser into a details.component.yaml + details.twig directory, fixes schema errors, and shows SDC auto-includes CSS/JS and emits helpful dev errors. Schemas use JSON Schema for props/slots (twig blocks), modules require schemas while themes may omit them, components can replace theme modules, and Storybook hooks exist via CL server.
AI-written summary · about
chapters (21)
- 0:00Introduction and background
- 3:12Problem with Drupal’s front-end
- 5:18Why components matter
- 6:24Benefits of single directory
- 7:07Coding karaoke demo starts
- 10:41Converting component to SDC
- 14:43Fixing schema and errors
- 17:09Handling assets and paths
- 20:58Finalizing the component
- 22:03Component metadata explained
- 25:38Component replacement rules
- 27:05Future plans for SDC
- 28:33Integration with design systems
- 30:16How to contribute and help
- 30:57Q&A: Template dependency
- 33:30Q&A: Asset organization
- 34:53Q&A: SASS compilation
- 36:20Q&A: Storybook integration
- 37:24Q&A: Library overrides
- 40:36Q&A: Fast-tracking to core
- 42:42Q&A wrap-up and thanks
