#64122 closed defect (bug) (fixed)
Interactivity API: Add data-wp-router-region directive to the script modules of interactive blocks
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.9 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Interactivity API | Keywords: | has-patch has-unit-tests |
| Focuses: | Cc: |
Description
WordPress 6.9 will introduce a new client-side navigation algorithm that starts loading JavaScript when you navigate between pages. However, loading script modules from non-interactive blocks during navigation isn't safe and could cause errors or unexpected behavior. To support this new navigation algorithm, we need a way to identify which script modules belong to interactive blocks in the HTML. This lets the Interactivity API router determine which modules it can safely load during client-side navigation and which ones it should skip.
Change History (4)
This ticket was mentioned in PR #10357 on WordPress/wordpress-develop by @luisherranz.
3 months ago
#1
- Keywords has-patch has-unit-tests added
@luisherranz commented on PR #10357:
3 months ago
#2
Thanks @westonruter!
This should be ready for a final review now.
#3
@
3 months ago
- Owner set to luisherranz
- Resolution set to fixed
- Status changed from new to closed
In 61019:
@luisherranz commented on PR #10357:
3 months ago
#4
No problem, I've already done it myself. Thanks a lot, Weston!
Committed in https://github.com/WordPress/wordpress-develop/commit/edaed03e22701b76e1c524084808527382da9aee (r61019).
This PR uses the
wp_script_attributesfilter to add thedata-wp-router-optionsdirective with theloadOnClientNavigation: trueproperty for all interactive blocks that are compatible with client-side navigation.Trac ticket: https://core.trac.wordpress.org/ticket/64122
Related Gutenberg PR: https://github.com/WordPress/gutenberg/pull/72449