-
Notifications
You must be signed in to change notification settings - Fork 649
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: consolidate createBranch logic
- Loading branch information
1 parent
c4fd6e7
commit ae24290
Showing
11 changed files
with
140 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@marko/translator-interop-class-tags": patch | ||
"marko": patch | ||
"@marko/runtime-tags": patch | ||
--- | ||
|
||
Consolidate create branch logic, optimizing code size and creating branches with only side effects and no template code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
const parsers: Record<string, Element> = {}; | ||
export function parseHTML(html: string, ns: string) { | ||
const parser = (parsers[ns] ||= document.createElementNS(ns, "template")); | ||
const content = | ||
((parser.innerHTML = html), | ||
(parser as HTMLTemplateElement).content || parser); | ||
if (!content.firstChild) content.appendChild(new Text()); | ||
return content as (DocumentFragment | Element) & { | ||
firstChild: ChildNode; | ||
lastChild: ChildNode; | ||
}; | ||
parser.innerHTML = html; | ||
return (parser as HTMLTemplateElement).content || parser; | ||
} |
Oops, something went wrong.