forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Interactivity API: Improvements to the experimental full-page navigat…
…ion (WordPress#64067) * fix: Add initial data population in interactivity router * chore: Update element.innerText to element.textContent in head.ts file * feat: Exclude src and href attributes when copying head element attributes * chore: Populate initial data in interactivity router * chore: Move Populate initial data in interactivity router * Wait for `load` event of script element before returning from `fetchHeadAssets()` function * feat: Update head tags to improve prefetching of scripts and stylesheets This commit modifies the `updateHead` function in `head.ts` to improve support for lazy loading of scripts and stylesheets. It preloades the script modules using `modulepreload`, imports the necessary scripts using dynamic imports and adds the `preload` link elements for stylesheets. * Do not load interactivity script modules in development mode when full page navigation is enabled * Format interactivity-api.php * Update interactivity script module registration to use version from asset files - Added logic to retrieve version information from `index.min.asset.php` and `router.min.asset.php` files. - Updated `wp_register_script_module` calls to use the retrieved version instead of the default version when full-page navigation is not enabled. * empty commit * Rename populateInitialData to populateServerData * remove populateServerData * try: remove the webpack comment * try: remove the await import() * bring back the async import * Move headElements to head.ts * Revert "try: remove the webpack comment" This reverts commit 62e527e. * default_version => router_version * Remove the changes to interactivity-api.php * Make `renderRegions` async * Update TS type of the stylesheets variable Co-authored-by: Jon Surrell <[email protected]> * Replace Array.from() with direct forEach() on NodeList in head.ts: * Check if href is null * Clarify why we only prefetch script modules * Add changelog --------- Co-authored-by: michalczaplinski <[email protected]> Co-authored-by: DAreRodz <[email protected]> Co-authored-by: sirreal <[email protected]> Co-authored-by: gziolo <[email protected]> Co-authored-by: luisherranz <[email protected]> Co-authored-by: westonruter <[email protected]>
- Loading branch information
1 parent
4714e52
commit 3793b28
Showing
3 changed files
with
106 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters