Merge pull request #1114 from isiahmeadows/editorconfig
Add an editorconfig to the rewrite
This commit is contained in:
commit
8d4db4bfa9
90 changed files with 1707 additions and 1701 deletions
10
.editorconfig
Normal file
10
.editorconfig
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
|
||||||
|
[*.js]
|
||||||
|
indent_style = tab
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
end_of_line = lf
|
||||||
|
|
@ -79,6 +79,3 @@ Type checks are generally already irreducible expressions and having micro-modul
|
||||||
You should be trying to reduce the number of DOM operations or reduce algorithmic complexity in a hot spot. Anything else is likely a waste of time. Specifically, micro-optimizations like caching array lengths, caching object property values and inlining functions won't have any positive impact in modern javascript engines.
|
You should be trying to reduce the number of DOM operations or reduce algorithmic complexity in a hot spot. Anything else is likely a waste of time. Specifically, micro-optimizations like caching array lengths, caching object property values and inlining functions won't have any positive impact in modern javascript engines.
|
||||||
|
|
||||||
Keep object properties consistent (i.e. ensure the data objects always have the same properties and that properties are always in the same order) to allow the engine to keep using JIT'ed structs instead of hashmaps. Always place null checks first in compound type checking expressions to allow the Javascript engine to optimize to type-specific code paths. Prefer for loops over Array methods and try to pull conditionals out of loops if possible.
|
Keep object properties consistent (i.e. ensure the data objects always have the same properties and that properties are always in the same order) to allow the engine to keep using JIT'ed structs instead of hashmaps. Always place null checks first in compound type checking expressions to allow the Javascript engine to optimize to type-specific code paths. Prefer for loops over Array methods and try to pull conditionals out of loops if possible.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -150,4 +150,3 @@ var things = [
|
||||||
{id: 1, name: "Cup"},
|
{id: 1, name: "Cup"},
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,4 +33,3 @@ This method is internally called by [`m.mount()`](mount.md) and [`m.route()`](ro
|
||||||
The `m.render` module is similar in scope to view libraries like Knockout, React and Vue. It is less than 500 lines of code (3kb min+gzip) and implements a virtual DOM diffing engine with a modern search space reduction algorithm and DOM recycling, which translate to top-of-class performance, both in terms of initial page load and re-rendering. It has no dependencies on other parts of Mithril and can be used as a standalone library.
|
The `m.render` module is similar in scope to view libraries like Knockout, React and Vue. It is less than 500 lines of code (3kb min+gzip) and implements a virtual DOM diffing engine with a modern search space reduction algorithm and DOM recycling, which translate to top-of-class performance, both in terms of initial page load and re-rendering. It has no dependencies on other parts of Mithril and can be used as a standalone library.
|
||||||
|
|
||||||
Despite being incredibly small, the render module is fully functional and self-suficient. It supports everything you might expect: SVG, custom elements, and all valid attributes and events - without any weird case-sensitive edge cases or exceptions. Of course, it also fully supports [components](components.md) and [lifecycle methods](lifecycle-methods.md).
|
Despite being incredibly small, the render module is fully functional and self-suficient. It supports everything you might expect: SVG, custom elements, and all valid attributes and events - without any weird case-sensitive edge cases or exceptions. Of course, it also fully supports [components](components.md) and [lifecycle methods](lifecycle-methods.md).
|
||||||
|
|
||||||
|
|
|
||||||
5
index.js
5
index.js
|
|
@ -1,4 +1,7 @@
|
||||||
"use strict"
|
"use strict"
|
||||||
|
|
||||||
|
/* eslint-disable global-require */
|
||||||
|
|
||||||
;(function () {
|
;(function () {
|
||||||
var Promise = require("./promise/promise")
|
var Promise = require("./promise/promise")
|
||||||
var m = require("./render/hyperscript")
|
var m = require("./render/hyperscript")
|
||||||
|
|
@ -18,4 +21,4 @@
|
||||||
|
|
||||||
if (typeof module === "object") module.exports = m
|
if (typeof module === "object") module.exports = m
|
||||||
else window.m = m
|
else window.m = m
|
||||||
})()
|
}())
|
||||||
|
|
|
||||||
|
|
@ -55,4 +55,3 @@ o.spec("normalize", function() {
|
||||||
o(node.children).equals(false)
|
o(node.children).equals(false)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,4 +17,3 @@ o.spec("normalizeChildren", function() {
|
||||||
o(children[0].children).equals("a")
|
o(children[0].children).equals("a")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue