You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"module": "commonjs",
|
|
|
|
"target": "ES5",
|
|
|
|
"outDir": "./",
|
|
|
|
"noImplicitAny": true,
|
|
|
|
"sourceMap": true,
|
|
|
|
"strictNullChecks": true,
|
|
|
|
"declaration": true,
|
|
|
|
"removeComments": false,
|
|
|
|
"noUnusedLocals": true,
|
|
|
|
"lib": [
|
|
|
|
"dom",
|
|
|
|
"es5",
|
|
|
|
"es2015.core"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"files": [
|
|
|
|
"src/helpers/attachto.ts",
|
|
|
|
"src/modules/attributes.ts",
|
|
|
|
"src/modules/class.ts",
|
|
|
|
"src/modules/dataset.ts",
|
|
|
|
"src/modules/eventlisteners.ts",
|
|
|
|
"src/modules/hero.ts",
|
|
|
|
"src/modules/props.ts",
|
|
|
|
"src/modules/module.ts",
|
|
|
|
"src/modules/style.ts",
|
|
|
|
"src/h.ts",
|
|
|
|
"src/htmldomapi.ts",
|
|
|
|
"src/hooks.ts",
|
|
|
|
"src/is.ts",
|
|
|
|
"src/snabbdom.bundle.ts",
|
|
|
|
"src/snabbdom.ts",
|
|
|
|
"src/thunk.ts",
|
Introduce toVNode() to reconstruct root element as vnode
This commit addresses issue #167. Previously, in snabbdom v0.5.0,
patch(element, vnode) would always create a new element for the root.
This resulted in problems with custom elements (web components), and was
fixed in commit c091c59c5946cb15f77d7ffca846f2cdae23b785.
However, that commit resulted in bug #167. This meant that snabbdom
would have bugs with server-side rendering, where the root element would
be non-empty (it has many children, rendered on the server-side as
HTML), and the client-side rendering should reuse those existing
children (or clear all the children and recreate them again in patch()).
This commit introduces the function toVNode(elm) that deep-converts an
element (and its tree) to a VNode (and its tree), that is separately
imported and used before calling patch(). toVNode(elm) will look at the
element's attributes and gather those as data for the vnode.
Overall, this commit is important for fixing #167 and enabling
client/server-side rendering in an efficient manner
(destruction/recreation client-side is probably too expensive).
8 years ago
|
|
|
"src/tovnode.ts",
|
|
|
|
"src/vnode.ts"
|
|
|
|
]
|
|
|
|
}
|