(doc: Document, html: string)
| 141 | * @returns a promise with the application ref |
| 142 | */ |
| 143 | export function prepareEnvironment(doc: Document, html: string) { |
| 144 | insertDomInDocument(doc, html); |
| 145 | globalThis.document = doc; |
| 146 | const scripts = doc.getElementsByTagName('script'); |
| 147 | for (const script of Array.from(scripts)) { |
| 148 | if (script?.textContent?.startsWith('window.__jsaction_bootstrap')) { |
| 149 | eval(script.textContent); |
| 150 | } |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * This bootstraps an application with existing html and enables hydration support |
no test coverage detected
searching dependent graphs…