@kaliber/build 0.0.150 → 0.0.151

Sign up to get free protection for your applications and to get access to all the features.
@@ -63,9 +63,18 @@ function createVirtualReactContainer({ initialNodes, startNode, endNode }) {
63
63
  removeEventListener: (...args) => parent.removeEventListener(...args),
64
64
  dispatchEvent: (...args) => parent.dispatchEvent(...args),
65
65
  get firstChild() { return nodes[0] || null },
66
- get nodeType() { return parent.DOCUMENT_FRAGMENT_NODE },
66
+ get nodeType() { return parent.ELEMENT_NODE },
67
67
  get ownerDocument() { return parent.ownerDocument },
68
68
  get nodeName() { return 'virtualized container' },
69
+ get textContent() { return '' },
70
+ set textContent(value) {
71
+ if (value) throw new Error(`Unexpected value set by React: "${value}"`)
72
+ nodes.forEach(node => parent.removeChild(node))
73
+ nodes.length = 0
74
+ },
75
+ get tagName() { return 'DIV' },
76
+ get namespaceURI() { return parent.namespaceURI },
77
+ get onclick() { return undefined }, // this is accessed as part of an obscure fix for bubbling behavior in Safari. By returning undefined we disable that 'fix'
69
78
  removeChild(child) {
70
79
  const result = parent.removeChild(child)
71
80
  nodes = nodes.filter(x => x !== child)
@@ -83,6 +92,7 @@ function createVirtualReactContainer({ initialNodes, startNode, endNode }) {
83
92
  return result
84
93
  },
85
94
  }
95
+
86
96
  // The statement below is a lie. We supply an object that has all methods that React calls on it
87
97
  return /** @type {Element} */ (container)
88
98
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.150",
2
+ "version": "0.0.151",
3
3
  "name": "@kaliber/build",
4
4
  "description": "Zero configuration, opinionated webpack / react build setup",
5
5
  "scripts": {