-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
- Part of Block API #41236.
The Interactivity API aims to provide a standard way to develop the frontend of Gutenberg blocks, in a way that they can communicate and be combined with each other easily.
Until now, most Gutenberg APIs have focused on the Block Editor, leaving an intentional gap in the frontend. The Interactivity API aims to cover that gap.
Imagine providing user experiences like instant search, add to cart, or comments form without a page reload, in a way that is immediately familiar and compatible with the block ecosystem, without complex scaffolding or external tools, and without sacrificing PHP server rendering and the plugin ecosystem. That's what the Interactivity API is for.
The goal of these tasks is to provide a basic runtime to start experimenting with interactivity in some of the core blocks.
We will start shaping the version of the runtime on a branch of the block interactivity experiments repo, and once it's ready we'll move it to this repository:
- Remove the router and leave only the Island hydration block-interactivity-experiments#216
- 🎨 Switch toVdom from array iteration to createTreeWalker block-interactivity-experiments#103
- Remove components and everything related to them block-interactivity-experiments#217
- Remove
wp-show
andwp-text
directives block-interactivity-experiments#220 - Remove _wrapped, expose directives and expose full store block-interactivity-experiments#223
- Solve bug of props passing to the next element (context) - won't fix! check this video
- Add wp-init and other small adjustments block-interactivity-experiments#225
- Fix
evaluate
so it is always the same function instance block-interactivity-experiments#224 (related issue) - Add Interactivity API runtime #49994
- Move the code to
/packages/block-library/src/interactivity
- Prepare a new webpack config with the runtime and the Navigation + Image lightbox view files, similar to this. Special attention to
runtimeChunk
- Enqueue runtime + vendors + views manually
- Add
defer
manually to the runtime + vendors + views - Add wp-init directive
- Move the code to
- Add a
useSignalEffect
implementation that behaves likeuseEffect
block-interactivity-experiments#226 - Add priorities to directives block-interactivity-experiments#235
- Experimental: Navigation block with the Interactivity API #50041
- File: Add experimental integration with Interactivity API #50377
- Behaviors UI #49972
- Image: Add lightbox using directives. #50373 (includes wp-portal)
- Support negation operator in selectors in the Interactivity API #50732
- Merge
vendors
andruntime
in a single file and rename the handle towp-interactive