_config.js — svelte Source File
Architecture documentation for _config.js, a javascript file in the svelte codebase. 2 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR ae60fb0d_9be2_211b_f6b7_3a3f6e090308["_config.js"] 654af6d6_2570_6860_f8dd_6b6131e1eec4["test.ts"] ae60fb0d_9be2_211b_f6b7_3a3f6e090308 --> 654af6d6_2570_6860_f8dd_6b6131e1eec4 54c2bfce_50b6_b8cc_4371_e1e14f283fb3["constants"] ae60fb0d_9be2_211b_f6b7_3a3f6e090308 --> 54c2bfce_50b6_b8cc_4371_e1e14f283fb3 style ae60fb0d_9be2_211b_f6b7_3a3f6e090308 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { COMMENT_NODE } from '#client/constants';
import { ok, test } from '../../test';
export default test({
html: `
<template id="t1">
<div>foo</div>
</template>
<template id="t2">123</template>
<template id="t3">1<b>B</b>1</template>
`,
test({ assert, target }) {
const template = /** @type {HTMLTemplateElement} */ (target.querySelector('#t1'));
assert.htmlEqual(
template.innerHTML,
`
<div>foo</div>
`
);
const content = /** @type {DocumentFragment} */ (template.content.cloneNode(true));
const div = content.children[0];
assert.htmlEqual(
div.outerHTML,
`
<div>foo</div>
`
);
const template2 = /** @type {HTMLTemplateElement} */ (target.querySelector('#t2'));
assert.equal(template2.childNodes.length, 0);
assert.equal(template2.content.childNodes.length, 1);
assert.equal(template2.content.firstChild?.textContent, '123');
assert.htmlEqual(template2.innerHTML, '123');
const template3 = /** @type {HTMLTemplateElement} */ (target.querySelector('#t3'));
// test: (with hydration from ssr rendered html)
// out of order render.
// <template>1{@html '2'}3</template> may render as <template>321</template> for ssr+hydration case.
// we bypass it by using symmetric siblings. hence <template> is not fully stable for this edge case.
// get all childNodes of template3 except comments
let childNodes = [];
for (const node of template3.content.childNodes) {
if (node.nodeType !== COMMENT_NODE) {
childNodes.push(/** @type {Element} */ (node));
}
}
assert.equal(childNodes.length, 3);
assert.equal(childNodes[0].textContent, '1');
assert.equal(childNodes[1].outerHTML, '<b>B</b>');
assert.equal(childNodes[2].textContent, '1');
}
});
Domain
Subdomains
Functions
Dependencies
- constants
- test.ts
Source
Frequently Asked Questions
What does _config.js do?
_config.js is a source file in the svelte codebase, written in javascript. It belongs to the BuildSystem domain, QualityControl subdomain.
What functions are defined in _config.js?
_config.js defines 1 function(s): default.test.
What does _config.js depend on?
_config.js imports 2 module(s): constants, test.ts.
Where is _config.js in the architecture?
_config.js is located at packages/svelte/tests/runtime-legacy/samples/template/_config.js (domain: BuildSystem, subdomain: QualityControl, directory: packages/svelte/tests/runtime-legacy/samples/template).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free