Skip to content

Commit

Permalink
Revert updates to interactivity router
Browse files Browse the repository at this point in the history
  • Loading branch information
michalczaplinski committed Sep 24, 2024
1 parent 455654e commit c531afd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
15 changes: 2 additions & 13 deletions packages/interactivity-router/src/head.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,11 @@ export const fetchHeadAssets = async (

const headElement = headElements.get( attributeValue );
const element = doc.createElement( tagName );
element.textContent = headElement.text;

element.innerText = headElement.text;
for ( const attr of headElement.tag.attributes ) {
// don't copy the src or href attribute
if ( attr.name !== 'src' && attr.name !== 'href' ) {
element.setAttribute( attr.name, attr.value );
}
element.setAttribute( attr.name, attr.value );
}

headTags.push( element );

// wait for the `load` event to fire before appending the element
return new Promise( ( resolve, reject ) => {
element.onload = resolve;
element.onerror = reject;
} );
} )
);
}
Expand Down
1 change: 0 additions & 1 deletion packages/interactivity-router/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ const regionsToVdom: RegionsToVdom = async ( dom, { vdom } = {} ) => {
// Render all interactive regions contained in the given page.
const renderRegions = ( page: Page ) => {
batch( () => {
populateInitialData( page.initialData );
if ( globalThis.IS_GUTENBERG_PLUGIN ) {
if ( navigationMode === 'fullPage' ) {
// Once this code is tested and more mature, the head should be updated for region based navigation as well.
Expand Down

0 comments on commit c531afd

Please sign in to comment.