-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement optimal reordering during hydration
During hydration we track the order in which children are claimed. Afterwards, rather than reordering them greedily one-by-one, we reorder all claimed children during the first append optimally. The optimal reordering first finds the longest subsequence of children that have been claimed in order. These children will not be moved. The rest of the children are reordered to where they have to go. This algorithm is guaranteed to be optimal in the number of reorderings. The hydration/head-meta-hydrate-duplicate test sample has been modified slightly. The order in which the <title> tag is being generated changed, which does not affect correctness.
- Loading branch information
Showing
2 changed files
with
169 additions
and
47 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
4 changes: 2 additions & 2 deletions
4
test/hydration/samples/head-meta-hydrate-duplicate/_after_head.html
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,4 +1,4 @@ | ||
<title>Some Title</title> | ||
<link href="/" rel="canonical"> | ||
<meta content="some description" name="description"> | ||
<meta content="some keywords" name="keywords"> | ||
<meta content="some keywords" name="keywords"> | ||
<title>Some Title</title> |