diff --git a/src/directives/reconcile.md b/src/directives/reconcile.md deleted file mode 100644 index 3f5239c..0000000 --- a/src/directives/reconcile.md +++ /dev/null @@ -1,33 +0,0 @@ -# Algorithme de reconciliation - -- tableaux - - prev [a, b, c, d, e, f, g] - - next [c, d, f, g, e, h, i] - - map next reversed index - -# Analyse - -<< in | >> out - -a != c & a >> next (delete) p=1 n=0 -b != c & b >> next (delete) p=2 n=0 -c == c & c << next (static) p=3 n=1 (ignore) -d == d & d << next (static) p=4 n=2 (ignore) -v -prev [a, b, c, d, e, f, g] -v -next [c, d, g, f, e, h, i] - -e != g & e << next (move 5) move > index p=5 n=2 (avoir un hidden index pour calculer la différence) -v -prev [a, b, c, d, e, f, g] -v -next [c, d, g, f, e, h, i] - -f != g & f << next (move 6) move > index p=6 n=2 -v--max = create all -prev [a, b, c, d, e, f, g] -v v -next [c, d, g, X, X, h, i] - -g == g & c << next (static) p=3 n=1 (ignore) diff --git a/tests/garbage/index.html b/tests/garbage/index.html index 3c6c724..f96c0f2 100644 --- a/tests/garbage/index.html +++ b/tests/garbage/index.html @@ -6,7 +6,7 @@ Garbage testing - +

Primary tests here

@@ -22,6 +22,7 @@

Primary tests here

number

+ diff --git a/tests/garbage/lit.js b/tests/garbage/lit.js new file mode 100644 index 0000000..fa72c70 --- /dev/null +++ b/tests/garbage/lit.js @@ -0,0 +1,104 @@ +import { + LitElement, + html, +} from "https://cdn.jsdelivr.net/gh/lit/dist@3/core/lit-core.min.js"; + +let id = 0; + +function _random(max) { + return Math.round(Math.random() * 1000) % max; +} + +function buildData(count = 1000) { + var adjectives = [ + "pretty", + "large", + "big", + "small", + "tall", + "short", + "long", + "handsome", + "plain", + "quaint", + "clean", + "elegant", + "easy", + "angry", + "crazy", + "helpful", + "mushy", + "odd", + "unsightly", + "adorable", + "important", + "inexpensive", + "cheap", + "expensive", + "fancy", + ]; + var colours = [ + "red", + "yellow", + "blue", + "green", + "pink", + "brown", + "purple", + "brown", + "white", + "black", + "orange", + ]; + var nouns = [ + "table", + "chair", + "house", + "bbq", + "desk", + "car", + "pony", + "cookie", + "sandwich", + "burger", + "pizza", + "mouse", + "keyboard", + ]; + var data = []; + for (var i = 0; i < count; i++) + data.push({ + id: id++, + label: + adjectives[_random(adjectives.length)] + + " " + + colours[_random(colours.length)] + + " " + + nouns[_random(nouns.length)], + }); + return data; +} + +class LitApp extends LitElement { + static properties = { + array: {}, + }; + constructor() { + super(); + this.array = []; + setTimeout(() => { + this.array = this.array.length ? [] : buildData(10000); + }, 1000); + setTimeout(() => { + this.array = this.array.length ? [] : buildData(10000); + }, 2000); + setTimeout(() => { + this.array = this.array.length ? [] : buildData(10000); + }, 3000); + } + render() { + return html`${this.array.map((item) => html`

${item.label}

`)}`; + } +} + +customElements.define("lit-app", LitApp); diff --git a/tests/garbage/components.js b/tests/garbage/vif.js similarity index 100% rename from tests/garbage/components.js rename to tests/garbage/vif.js