Developing WordPress blocks using plain JavaScript
summary
Claims that you can build Gutenberg blocks without installing Node.js or npm and then proves it step‑by‑step: creates block.json, block.js, block.asset.php, registers with PHP using register_block_type, and wires dependencies from window.wp.blocks and window.wp.element (adding wp.blockEditor/useBlockProps and a polyfill). Builds a basic form block in plain createElement calls and then shows the cleaner JSX/npm workflow (create‑block, build step) for comparison. Demo loads in the editor; plain JS works but is verbose and requires manual dependency and cache management.
AI-written summary · about
chapters (12)
- 0:00Introduction and setup
- 6:16Why plain JavaScript blocks
- 8:21Creating the block files
- 21:05Understanding block registration
- 33:03Testing and troubleshooting
- 42:23Working with block props
- 51:03Adding rich text components
- 1:00:42Nested elements with createElement
- 1:12:56Vanilla vs JSX comparison
- 1:22:27Automating with build tools
- 1:30:01Cross-browser compatibility
- 1:32:07Q&A session
