Opened 7 weeks ago
Last modified 7 weeks ago
#64360 new enhancement
enqueue_block_assets action ignores script modules
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Editor | Keywords: | has-patch |
| Focuses: | javascript | Cc: |
Description
The enqueue_block_assets action is used to add scripts and styles in the block editor's iframe.
It should be possible to add script modules to the block editor's iframe as well.
See:
- _wp_get_iframed_editor_assets and its documentation.
- The WP_Script_Modules class.
- The block editor Iframe component in Gutenberg.
This will likely require a new method or exposing more of the script modules internal data so that a specific WP_Script_Modules instance can be used for the iframed assets. See #60597.
Change History (2)
This ticket was mentioned in PR #10597 on WordPress/wordpress-develop by @jonsurrell.
7 weeks ago
#1
- Keywords has-patch added
#2
@
7 weeks ago
I've have a functional implementation in https://github.com/WordPress/wordpress-develop/pull/10597 and https://github.com/WordPress/gutenberg/pull/73765.
The changes seem straightforward, the only question may be around how to "clone" the global $wp_script_modules instance.
I'm sharing the work informationally, not to reserve this task for myself if folks are interested in working on it.
Trac ticket: https://core.trac.wordpress.org/ticket/64360