-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add defer init flag container test (#3792)
- Loading branch information
1 parent
061b9fe
commit 5c35260
Showing
11 changed files
with
202 additions
and
30 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
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
17 changes: 17 additions & 0 deletions
17
container/test-app/compound/defer-init-wc/compoundWCDeferInit1.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* This class is used to test Compound Container defer-init functionality | ||
*/ | ||
export default class extends HTMLElement { | ||
constructor() { | ||
super(); | ||
const shadowRoot = this.attachShadow({ mode: 'open' }); | ||
const template = document.createElement('template'); | ||
template.innerHTML = `<section><h3 style="border: solid blue 2px;" id="defer-init-flag"> Hello From Web Component 1 </h3></section>`; | ||
shadowRoot.appendChild(template.content.cloneNode(true)); | ||
this.$paragraph = shadowRoot.getElementById('defer-init-flag'); | ||
} | ||
|
||
set context(ctx) { | ||
this.$paragraph.innerHTML += ctx.content; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
container/test-app/compound/defer-init-wc/compoundWCDeferInit2.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* This class is used to test Compound Container defer-init functionality | ||
*/ | ||
export default class extends HTMLElement { | ||
constructor() { | ||
super(); | ||
const shadowRoot = this.attachShadow({ mode: 'open' }); | ||
const template = document.createElement('template'); | ||
template.innerHTML = `<section><h3 style="border: solid blue 2px;" id="paragraph"> Hello From Web Component 2 </h3></section>`; | ||
shadowRoot.appendChild(template.content.cloneNode(true)); | ||
this.$paragraph = shadowRoot.getElementById('paragraph'); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- This microfrontend HTML file is used to test defer init functionality --> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title></title> | ||
<meta charset="utf-8" /> | ||
</head> | ||
|
||
<body style="border: solid blue 2px;"> | ||
<div> | ||
<h1>defer-init test for iframes</h1> | ||
</div> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* This class is used to test container defer-init functionality | ||
*/ | ||
export default class extends HTMLElement { | ||
constructor() { | ||
super(); | ||
const shadowRoot = this.attachShadow({ mode: 'open', delegatesFocus: false }); | ||
const template = document.createElement('template'); | ||
template.innerHTML = `<section><h2 style="border: solid blue 2px;" id="defer-init-flag"> This is a webcomponent based microfrontend container </h2></section>`; | ||
shadowRoot.appendChild(template.content.cloneNode(true)); | ||
this.$paragraph = shadowRoot.getElementById('defer-init-flag'); | ||
} | ||
|
||
set context(ctx) { | ||
this.$paragraph.innerHTML += ctx.content; | ||
} | ||
} |