Skip to content

Commit

Permalink
refactor: golf -- better gzip, worse brotli
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Apr 30, 2024
1 parent 58a043a commit 7f3d7cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,12 @@ function renderComponent(component) {
newVNode,
oldVNode,
component._globalContext,
component._parentDom.namespaceURI == 'http://www.w3.org/1999/xhtml'
? 1
: component._parentDom.namespaceURI == 'http://www.w3.org/2000/svg'
component._parentDom.namespaceURI == 'http://www.w3.org/2000/svg'
? 2
: 3,
: component._parentDom.namespaceURI ==
'http://www.w3.org/1998/Math/MathML'
? 3
: 1,
oldVNode._flags & MODE_HYDRATE ? [oldDom] : null,
commitQueue,
oldDom == null ? getDomSibling(oldVNode) : oldDom,
Expand Down
8 changes: 4 additions & 4 deletions src/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ export function render(vnode, parentDom, replaceNode) {
vnode,
oldVNode || EMPTY_OBJ,
EMPTY_OBJ,
parentDom.namespaceURI == 'http://www.w3.org/1999/xhtml'
? 1
: parentDom.namespaceURI == 'http://www.w3.org/2000/svg'
parentDom.namespaceURI == 'http://www.w3.org/2000/svg'
? 2
: 3,
: parentDom.namespaceURI == 'http://www.w3.org/1998/Math/MathML'
? 3
: 1,
!isHydrating && replaceNode
? [replaceNode]
: oldVNode
Expand Down

0 comments on commit 7f3d7cb

Please sign in to comment.