-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* perf: attr & escape helper optimization * perf: optimize server component * perf: dynamic tag perf improvements * perf: prevent escaping json attrs, optimize nonce * perf: legacy widget & dynamic tag key serialization improvement * perf: prevent serializing component props for legacy components * fix: auto key regexp for dynamic tag * perf: prevent creating constructors for implicit components (cherry picked from commit ff82248)
- Loading branch information
1 parent
6b3156f
commit 1fed43e
Showing
21 changed files
with
213 additions
and
197 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 |
---|---|---|
@@ -1,7 +1,3 @@ | ||
{ | ||
"dependencies": [ | ||
"require: ./*.js", | ||
"require: ./vdom/*.js", | ||
"require-run: ./components/legacy/dependencies/vdom" | ||
] | ||
"dependencies": ["require: ./*.js", "require: ./vdom/*.js"] | ||
} |
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
7 changes: 0 additions & 7 deletions
7
packages/marko/src/runtime/components/GlobalComponentsContext.js
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,16 +1,9 @@ | ||
var nextComponentIdProvider = require("./util").___nextComponentIdProvider; | ||
var KeySequence = require("./KeySequence"); | ||
|
||
function GlobalComponentsContext(out) { | ||
this.___renderedComponentsById = {}; | ||
this.___rerenderComponent = undefined; | ||
this.___nextComponentId = nextComponentIdProvider(out); | ||
} | ||
|
||
GlobalComponentsContext.prototype = { | ||
___createKeySequence: function() { | ||
return new KeySequence(); | ||
} | ||
}; | ||
|
||
module.exports = GlobalComponentsContext; |
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,25 +1,16 @@ | ||
function KeySequence() { | ||
this.___lookup = {}; | ||
this.___lookup = Object.create(null); | ||
} | ||
|
||
KeySequence.prototype = { | ||
___nextKey: function(key) { | ||
// var len = key.length; | ||
// var lastChar = key[len-1]; | ||
// if (lastChar === ']') { | ||
// key = key.substring(0, len-2); | ||
// } | ||
var lookup = this.___lookup; | ||
KeySequence.prototype.___nextKey = function(key) { | ||
var lookup = this.___lookup; | ||
|
||
var currentIndex = lookup[key]++; | ||
if (!currentIndex) { | ||
lookup[key] = 1; | ||
currentIndex = 0; | ||
return key; | ||
} else { | ||
return key + "_" + currentIndex; | ||
} | ||
if (lookup[key]) { | ||
return key + "_" + lookup[key]++; | ||
} | ||
|
||
lookup[key] = 1; | ||
return key; | ||
}; | ||
|
||
module.exports = KeySequence; |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var counter = 0; | ||
var seed = "M" + Math.random().toFixed(5); | ||
module.exports = | ||
global.WeakMap || | ||
function WeakMap() { | ||
var id = seed + counter++; | ||
return { | ||
get: function(ref) { | ||
return ref[id]; | ||
}, | ||
set: function(ref, value) { | ||
ref[id] = value; | ||
} | ||
}; | ||
}; |
Oops, something went wrong.