Skip to content

Commit 2d30ade

Browse files
committed
Merge branch 'gh-pages' of https://github.com/LivelyKernel/lively4-core into gh-pages
2 parents 4cebade + 408c7b7 commit 2d30ade

File tree

11 files changed

+53
-15
lines changed

11 files changed

+53
-15
lines changed

demos/tom/babel-plugin-tracer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import Trace from 'demos/tom/trace.js';
22
import wrapAST from 'demos/tom/wrapAST.js';
33

4+
'hello world'
5+
46
let pluginDefinedTrace = false;
57

68
export default function({ types: t }) {

demos/tom/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ Es ist möglich das trace plugin mit sich selbst zu debuggen. Dazu wird einfach
8383
* Diff was ist dazu gekommen; was wurde entfernt während des changes
8484
* AST-compare sollte direkt die Änderung aufgeklappt haben (cool: farblich markieren)
8585
* Im Plugin code markieren und anzeigen welche konkreten Traces darüber gelaufen sind
86+
* "brushing and linking"
87+
- **whence** and **whither** === wohin und woher
88+
- **What if** === Was wäre, wenn
8689

8790
## Known problems
8891
* Wenn zu viele Daten generiert werden (weil entweder das plugin oder der gegebene Code zu viel sind) ist der Worker nicht mehr in der Lage dazu die Daten zu senden, was darin endet, dass das TraceVisualization Tool nicht mehr funktioniert. Dies liegt anscheinend daran, dass während eines Aufrufs von JSON.stringify der Fehler: _rangeerror invalid string length_ geworfen wird

src/client/reactive/babel-plugin-active-expression-rewriting/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ export default function (babel) {
188188
pre(file) {
189189
//console.log("fff", file, traverse);
190190
},
191+
name: 'active-expression-rewriting',
191192
visitor: {
192193
Program: {
193194
enter(path, state) {

src/components/tools/lively-index-search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export default class IndexSearch extends Morph {
271271

272272
var newText = file.text.replace(new RegExp(this.pattern, "g"), this.replace)
273273
file.replaced = newText
274-
var replacedText = this.hightlightPattern(newText, this.replace)
274+
var replacedText = this.hightlightPattern(newText, RegExp.escape(this.replace))
275275
var replacePreviewColumn = <td id="replace">{replacedText}</td>
276276
file.item.appendChild(replacePreviewColumn)
277277

src/components/tools/lively-inspector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default class Inspector extends Morph {
3030
}
3131

3232
displayValue(value, expand, name) {
33-
if (name) {
33+
if (name !== undefined && name !== null) {
3434
let attrValue;
3535
if (value && typeof value === 'symbol') {
3636
attrValue = value.toString();

src/components/tools/lively-plugin-explorer-playground.workspace

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"sources": [
44
"https://lively-kernel.org/lively4/lively4-tom/src/components/tools/lively-ast-explorer-example-source.js"
55
],
6-
"plugin": "src/client/reactive/babel-plugin-active-expression-rewriting/index.js",
6+
"plugin": "demos/tom/plugin-backup.js",
77
"options": {
88
"autoUpdateAST": true,
99
"autoUpdateTransformation": true,
@@ -13,11 +13,17 @@
1313
"autoSaveWorkspace": false
1414
},
1515
"pluginSelection": [
16+
{
17+
"url": "src/client/reactive/babel-plugin-active-expression-rewriting/index.js"
18+
},
1619
{
1720
"url": "demos/tom/plugin-backup.js"
1821
},
1922
{
20-
"url": "src/client/reactive/babel-plugin-active-expression-rewriting/index.js"
23+
"url": "src/external/babel-plugin-var-recorder-dev.js"
24+
},
25+
{
26+
"url": "src/external/babel-plugin-locals.js"
2127
}
2228
]
2329
}

src/components/tools/lively-plugin-explorer.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@
201201
<lively-separator reverse=true></lively-separator>
202202

203203
<div id="bottom" class="pane layout-row">
204-
<div id="console" class="pane tool layout-column">
204+
<div id="console" class="pane tool layout-column" >
205205
<b>Execution Console</b>
206-
<div class="pane">
206+
<div class="pane" style="overflow: scroll">
207207
<pre id="executionConsole"></pre>
208208
</div>
209209
</div>

src/components/tools/plugin-selector.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,4 @@ export default class PluginSelector extends Morph {
268268

269269
}
270270

271-
livelyInspect(contentNode, inspector) {
272-
// do nothing
273-
}
274-
275271
}

src/components/tools/trace-visualization.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import babelDefault from 'systemjs-babel-build';
22
const babel = babelDefault.babel;
3-
import loadPlugin from 'demos/tom/plugin-load-promise.js'
4-
import sourcemap from 'src/external/source-map.min.js'
3+
import loadPlugin from 'demos/tom/plugin-load-promise.js';
4+
import sourcemap from 'src/external/source-map.min.js';
5+
import {debounce} from 'utils';
56
import Trace from 'demos/tom/trace.js';
67

78
import Morph from 'src/components/widgets/lively-morph.js';
@@ -21,6 +22,13 @@ export default class TraceVisualization extends Morph {
2122
this.trace;
2223
this.curAST;
2324
this.nextAST;
25+
26+
let debounced = _.debounce(() => this.editor.currentEditor().listSelections()[0].openInInspector(), 500);
27+
28+
this.editor.awaitEditor().then(() => {
29+
debounced.cancel();
30+
debounced();
31+
});
2432
}
2533

2634

@@ -73,7 +81,6 @@ export default class TraceVisualization extends Morph {
7381
this.textManuallyChanged = false;
7482
}
7583
}
76-
7784
/*MD ## Update list MD*/
7885

7986
clearList() {

templates/template.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ export default class $$TEMPLATE_CLASS extends Morph {
6363
// this method is called on the new object during migration, but before initialization
6464
this.someJavaScriptProperty = other.someJavaScriptProperty
6565
}
66-
66+
67+
/*
6768
livelyInspect(contentNode, inspector) {
68-
// do nothing
69+
// overrides how the inspector displays this component
6970
}
71+
*/
7072

7173
async livelyExample() {
7274
// this customizes a default instance to a pretty example

0 commit comments

Comments
 (0)