|
@@ -6,15 +6,13 @@ let t: HTMLTemplateElement
|
|
|
/*! #__NO_SIDE_EFFECTS__ */
|
|
/*! #__NO_SIDE_EFFECTS__ */
|
|
|
export function template(html: string, root?: boolean) {
|
|
export function template(html: string, root?: boolean) {
|
|
|
let node: Node
|
|
let node: Node
|
|
|
- return (n?: number): Node & { $root?: true } => {
|
|
|
|
|
|
|
+ return (): Node & { $root?: true } => {
|
|
|
if (isHydrating) {
|
|
if (isHydrating) {
|
|
|
if (__DEV__ && !currentHydrationNode) {
|
|
if (__DEV__ && !currentHydrationNode) {
|
|
|
// TODO this should not happen
|
|
// TODO this should not happen
|
|
|
throw new Error('No current hydration node')
|
|
throw new Error('No current hydration node')
|
|
|
}
|
|
}
|
|
|
node = adoptTemplate(currentHydrationNode!, html)!
|
|
node = adoptTemplate(currentHydrationNode!, html)!
|
|
|
- // dynamic node position, default is 0
|
|
|
|
|
- ;(node as any).$dp = n || 0
|
|
|
|
|
if (root) (node as any).$root = true
|
|
if (root) (node as any).$root = true
|
|
|
return node
|
|
return node
|
|
|
}
|
|
}
|