Shahar Dawn Or
814c2e50d7
style: four eslint rules enabled ( #548 )
...
- import/newline-after-import
- dot-notation
- import/first
- no-undef
5 years ago
zymfe
f98dcabfa9
chore: merge statement
5 years ago
Shahar Dawn Or
2dc536a394
test: strict assertions ( #529 )
5 years ago
Shahar Dawn Or
14d7e0af25
style: lint .tsx ( #530 )
...
Fixes #528 .
5 years ago
Shahar Dawn Or
6eacf72763
style: no-sequences, no-void, quote-props ( #527 )
5 years ago
Shahar Dawn Or
ad3745bfe8
style: single quotes ( #526 )
5 years ago
Shahar Dawn Or
431f95018e
fix: include JSX related module in package ( #524 )
...
Fixes #503 .
5 years ago
Shahar Dawn Or
a2342e6875
style: normalize whitespace ( #510 )
5 years ago
Shahar Dawn Or
b77cb512f4
refactor(tests): convert to TypeScript ( #508 )
...
Closes #293 .
Fixes #509 .
5 years ago
Noj Vek
f8774a96f5
comment
5 years ago
Noj Vek
0c7f9ddd16
jsx vnode child types
5 years ago
Noj Vek
69294d8cb6
nit
5 years ago
Noj Vek
5035aed23a
Merge branch 'master' of github.com:snabbdom/snabbdom into nojvek-h-tsx
5 years ago
Simon Friis Vindum
0881343e01
Update TypeScript, refactor
5 years ago
Noj Vek
7ff8d13b4e
snabbdom can be used with jsx/tsx via jsxFactory: jsx
5 years ago
Shahar Or (mightyiam)
dcdde2e869
style: @typescript-eslint/array-type
5 years ago
Shahar Or (mightyiam)
a907828f12
chore: editorconfig + checker
5 years ago
Jan van Brügge
f307db46e3
Fix element removal on transition end in Firefox70
5 years ago
octuplesakura
0a3bc6fdf4
refact: Small part of the grammar optimization
6 years ago
paldepind
425a6b2ded
Add comment documenting bug-fix
6 years ago
Simon Friis Vindum
3b04714e81
Merge pull request #409 from whitecolor/patch-3
...
Fix for #360 error in IE/Edge
6 years ago
Simon Friis Vindum
29b2829f16
Merge pull request #378 from kay999/master
...
Updated documentation for eventlisteners and fixed missing event/vnode for arrays of handlers
6 years ago
Alex
695da13ec5
Fix for #360 error in IE/Edge
...
Binding raf to window resolves the error.
6 years ago
Marius Muja
6a632c2872
Fix for patching node with text over node with children
6 years ago
Jan van Brügge
953a326757
Force page reflow before applying styles
7 years ago
Luiz Américo
93787151e2
Remove redundant is.array check in h
7 years ago
kay999
b9f2db2e60
Update eventlisteners.ts
7 years ago
Tobias Lidskog
d7a38d71b7
Refactor to remove function casting.
...
Casting the setAttribute and setAttributeNS functions at each call site make the code harder to read. Instead extract the new overloads for Element into a global declare statement.
This does not change the generated javascript code, just makes the typescript easier to read.
7 years ago
Frederique Mittelstaedt
584f2c5334
Fix for issue 361
7 years ago
K
fb04f628f3
Fixed missing domApi argument in recursive toVNode() call
7 years ago
Caridy Patiño
dbb4d2dae5
Merge pull request #351 from caridy/caridy/issue-348
...
fixes issue #348 : perf optimization during diffing algo to avoid calling addVNodes and removeVNodes when there is nothing to do
7 years ago
Caridy
b7f90368ee
fixes issue #348 : perf optimization during diffing algo to avoid calling addVNodes and removeVNodes when there is nothing to do.
7 years ago
Strider
17a6d312bb
h: allow VNodesSparse to accept single VNode, because underlying mechanism actually allows it.
8 years ago
Strider
806a5e7b30
h: reduce duplication, by bringing VNodes and VNodesSparse types.
8 years ago
Yarom Shoval
8b92071c69
Tiny type check in call to `vnode` at `h.ts`
8 years ago
Andre Staltz
d00ae793a6
Support DocumentFragment in toVNode
8 years ago
Simon Friis Vindum
ecd2b1a38d
Merge pull request #314 from caridy/caridy/boolean-attributes
...
fixes issue #306 and others: boolean attributes alignment with HTML
8 years ago
Churchill Lee
16b14888b7
refactor(dataset): protect delete invocation only
8 years ago
Caridy
702a0af1e8
fixes issue #306 and others: boolean attributes alignment with HTML
8 years ago
Churchill Lee
06c9cfbb47
fix(dataset): check if property exist before deleting
...
in Safari, when it is `use strict`, if the dataset property is removed in DOM
deleting it again will cause an error
closes #309
8 years ago
Simon Friis Vindum
7b45afea49
Merge pull request #289 from astroK8/master
...
PR for issue #262 (remove draggable of boolean attributes)
8 years ago
Yarom Shoval
a5b93a7137
VNode key property can be undefined
...
Because actually it can be undefined:
4adbd971cb/src/vnode.ts (L44)
8 years ago
Andre Staltz
0601d7d94a
Fix style module logic when delayed field is optional
8 years ago
Jan van Brügge
836968509e
style module: make delayed and remove property optional
...
PR #296
8 years ago
Andre Staltz
4b4a34ad0f
Fix toVNode() for comment nodes, lacking some fields
...
Comment nodes when converted to VNode were lacking vnode.data and
vnode.elm, which in turn would break use cases with modules such as the
style module (Which assumed vnode.data to be defined). Since toVNode is
used as an initial step (e.g. for server-side rendered content), there
is no reason to not provide vnode.elm since that vnode may be used as
the "prevVNode" during patch. Also, because comment vnodes have the '!'
sel, most logic in snabbdom that detects a truthy sel will also assume a
truthy data field. It is easier to build the comment vnode with those
fields than to modify all the logic elsewhere in snabbdom.
8 years ago
Shahar Or (mightyiam)
f3354732bf
fix #291
8 years ago
Simon Friis Vindum
8f75eb9aef
Merge pull request #271 from mightyiam/type
...
type VNode props (fixes #264 )
8 years ago
cesare soldini
1826bcd3c6
Bugfix: thunk function called two times
...
PR #273
* Separate test blocks with newlines
* Add a 🔴 failing test that highlights the bug, and some other more detailed tests on thunk renderings
* Fix the bug ✅
* Correctly gitignore files in base directory
The existing configuration was ignoring the same filenames in subdirectories, for example `test/thunk.js`
* Remove newlines between test blocks
* Make tests titles more explicative
8 years ago
aymeric
f7aa66d865
PR for issue #262 (remove draggable for boolean attributes)
8 years ago
Thibault Duplessis
c5d513dfd9
Update `h` signature; children nodes can now be undefined or null
...
Required now that #226 is implemented.
8 years ago
Shahar Or (mightyiam)
4adbd971cb
improvements to VNodeData types
8 years ago
Shahar Or (mightyiam)
08650378be
Merge branch 'master' into type
8 years ago
caesarsol
c37321ca12
Use elm.setAttribute('class', ...) instead of elm.className = ... to make it work in SVGs
8 years ago
Shahar Or (mightyiam)
9dfa5d6f3c
type VNode props ( fixes #264 )
8 years ago
Diego Ferreiro Val
4ede863df2
Performance improvement for attribute patching: ( #257 )
...
* Performance improvements for attribute patching:
- Avoid call to split and use a object lookup instead
- Simplify the code for `svg` name spaced attributes
* Fix typo and added missing property
* Fixing previous attribute ns assignment
* Refactor NS
* Add fast path for non namespaced elements
* Adding tests
8 years ago
paldepind
511b29a6a6
Set boolean attributes correctly according to spec
8 years ago
Tom Bakker
1a0adb1c95
fix tovnode to ensure text elements can be removed
8 years ago
André Staltz
9ee3be8b5a
Merge pull request #234 from caridy/create-workflow-to-align-with-update
...
Create element workflow should align with update element workflow
8 years ago
Andre Staltz
c368eb3163
Fix dataset module to support old browsers
...
At least IE10 does not support the elm.dataset property, so we must use
elm.removeAttribute and elm.setAttribute instead.
8 years ago
Andre Staltz
a0033a635d
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 c091c59c59
.
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
Simon Friis Vindum
9be854410e
Merge pull request #232 from nunocastromartins/handle-null-children
...
Support for null/undefined children
8 years ago
Nuno Martins
367eef52f8
Fix #226 . Support for `null`/`undefined` children
...
This commit makes the patching algorithm ignore `null` and `undefined`
children. This means that, whenever children are iterated, the algorithm
must check for possible `null` and `undefined` values.
8 years ago
André Staltz
3efe5612d7
Merge pull request #229 from pedrosland/feature/comments
...
Add ability to create comment nodes
8 years ago
Caridy
6594a20fde
Create element workflow to align with update element workflow
8 years ago
zhulongzheng
18ef17db31
Update of #228
8 years ago
Peter Sutherland
bb86adef8c
Add ability to create comment nodes
8 years ago
zhulongzheng
f6eacf3993
Fix compatibility issue of String.prototype.startsWith
8 years ago
Andre Staltz
1b0163cb94
Fix modules/module file to be TypeScript source
...
In order for other TypeScript code to consume snabbdom's TypeScript
correctly, we must "export" the modules/module interface just like
we export other types.
8 years ago
Andre Staltz
ef8b60993b
Fix hooks file to be TypeScript source
...
In order for other TypeScript code to consume snabbdom's TypeScript
correctly, we must "export" the hooks interfaces just like we export
other types.
8 years ago
Caridy
687db9f99b
[perf-optimization] skip unnecessary work in modules that can support memoization of the data structure consumed by them
8 years ago
paldepind
673e2a7e7b
Merge branch 'use-typeof'
8 years ago
Simon Friis Vindum
7da866270a
Merge pull request #210 from aronallen/fix/ie11svg
...
use parentNode instead of parentElement
8 years ago
Aron Allen
fa88c0e888
removed all references to parentElement, changed to parentNode. updated types
8 years ago
Simon Friis Vindum
3bd0068156
Merge pull request #213 from tdumitrescu/svg-ns-fix
...
Fix Custom Element creation when tag name begins with 'svg'
8 years ago
teddddd
72cdb52e1d
Fix Custom Element creation when tag name begins with 'svg'
...
The check at https://github.com/snabbdom/snabbdom/blob/f79af828/src/h.ts#L37
is too loose, and ends up adding the svg namespace to elements with
tagNames such as svg-icon, which prevents web components lifecycle
callbacks from firing.
8 years ago
Aron Allen
bec0d9ab80
use parentNode instead of parentElement
8 years ago
Jorge Bucaran
00b9224d85
Check that children data !== undefined before calling addNS
...
Otherwise svg is broken.
8 years ago
paldepind
27993fcadf
Typing for module hooks and `h` data
8 years ago
paldepind
9a21abafcb
Cast `elm` once
8 years ago
paldepind
dccd3d4800
Satisfy strict null checks
8 years ago
Simon Friis Vindum
f79af82881
Merge pull request #195 from jlesquembre/css-variables
...
Add support for css variables
8 years ago
paldepind
f552b0e8ed
Tweak types, reduce casting
8 years ago
José Luis Lafuente
ccbf30f0c6
Add support for css variables
8 years ago
Simon Friis Vindum
cd952ac52f
Merge pull request #188 from zhulongzheng/patch
...
Fix bug of updating one child with same key but different sel.
8 years ago
Alexandre Galays
5a5c0dc121
Allow h(sel, data, node) and h(sel, node) shortcut notations
8 years ago
zhulongzheng
8ffb4eb91a
Fix bug of updating one child with same key but different sel
8 years ago
Andre Staltz
091dc5f961
Migrate from CommonJS modules to ES2015 modules
8 years ago
Andre Staltz
499cd37b06
Migrate source code to TypeScript v2.0
8 years ago