|
| 1 | +# Andre Staltz Codementor 9/11/17 |
| 2 | + |
| 3 | +## Links on "CycleJS as IDE" |
| 4 | + |
| 5 | +* https://medium.com/open-collective/cycle-js-a-unified-theory-of-everything-for-javascript-e266ac9a59ad |
| 6 | +* https://vimeo.com/217444733 |
| 7 | +* https://github.com/Widdershin/bonsai-editor |
| 8 | +* https://github.com/Widdershin/stream-tree |
| 9 | +* making sure everything can be visual (pool, math.random) https://github.com/cyclejs/cyclejs/issues/581 |
| 10 | + |
| 11 | + |
| 12 | +## How devtools work |
| 13 | + |
| 14 | +* window.Cyclejs gives you metadata for the app, shares with devtools |
| 15 | + * window.Cyclejs comes from `run |
| 16 | + * has sinks, final node at bottom of graph, what is rendered on DOM |
| 17 | +* traverse starting at the sink to the nodes above it (graphSerializer) |
| 18 | + * https://github.com/cyclejs/cyclejs/blob/master/devtool/src/graphSerializer.ts#L357 (starts here) |
| 19 | + * https://github.com/cyclejs/cyclejs/blob/master/devtool/src/graphSerializer.ts#L329 |
| 20 | + * `buildGraph` goes through each node from sinks (sinks are streams) https://github.com/cyclejs/cyclejs/blob/master/devtool/src/graphSerializer.ts#L160 |
| 21 | + * `idTable` is just a JS map for an ID number for each node |
| 22 | + * `traverse` does a depth-first search and registers those nodes https://github.com/cyclejs/cyclejs/blob/master/devtool/src/graphSerializer.ts#L138 |
| 23 | + * 1) stream has producer, listening to something, operator like `map` or `filter`, but anything that produce data, like `addEventListener` which isn't an operator (which you can find in xstream codebase) |
| 24 | + * `ins` property: input straem |
| 25 | + * 2) `insArr`: many input streams, like `merge` |
| 26 | + * 3) `_prod`: source nodes, grey boxes at top |
| 27 | + * then run `layout` which gives x and y for nodes |
| 28 | + * serialize https://github.com/cyclejs/cyclejs/blob/master/devtool/src/graphSerializer.ts#L335 |
| 29 | +* panel/index gets stream of JSON https://github.com/cyclejs/cyclejs/blob/master/devtool/src/panel/index.ts#L66 |
| 30 | +* panel/model parses |
| 31 | +* panel/view renders |
| 32 | + |
| 33 | + |
| 34 | +## data -> code |
| 35 | + |
| 36 | +* go from data structure to code |
| 37 | + * use the dagre structure (nodes and edges) |
| 38 | + * there are some hidden data (what is being mapped, what is being folded) |
| 39 | +* also considering writing a DSL |
| 40 | + * limiting JS expressivity |
| 41 | + * related to push/pull thing (disable Math.random type of thing), so basically like seperating side effects / monads |
| 42 | +* signal and stream |
| 43 | + * signals are the pull thing |
| 44 | + * like Elm, if a function has no arguments, it should be a constant |
| 45 | + |
| 46 | +## difference between Elm and Cyclejs |
| 47 | + |
| 48 | +* first class streams in CycleJS |
| 49 | +* Elm has callbacks, but CycleJS treats clicks as "coming from outside the program" |
| 50 | + * Actions, not callbacks |
| 51 | + * with the same data structure, you're defining those two things, the output and input |
| 52 | + * the way CycleJS gets around this is by refering with classnames or ids |
| 53 | + * you can then get a graph from these things, not sure if you can do this in Elm |
| 54 | + * even if you could get this graph from Elm code, it's less aparent in the texual code |
| 55 | + |
| 56 | + |
| 57 | +## noFlo |
| 58 | + |
| 59 | +* not going to go down this road |
| 60 | +* the nodes are allowed to do side effects |
| 61 | + * In Cycle, devtools, grey is not in app, blue is transformations |
| 62 | +* could just use subset of noFlo |
| 63 | +* benefit from building something custom and constrained |
| 64 | + * simple and optimized for this use case |
| 65 | + |
| 66 | +## constructing HTML in devtools |
| 67 | + |
| 68 | +* there are some use cases where text is better |
| 69 | + * for example, BMI calculation |
| 70 | +* the goal here is to replace the sublime text minimap |
| 71 | +* summary of your code that's 90% complete |
| 72 | +* also ability to add the box in the editor and then see what that code will be |
| 73 | + * directly would affect the code in my editor, somehow sync to text editor, parse code to AST |
| 74 | +* eventually if we wanted 100% IDE then snipets for code in the boxes |
| 75 | + |
| 76 | + |
| 77 | +## StreamSheets |
| 78 | + |
| 79 | +* sounds like Eve |
| 80 | + * they have a table of clicks |
| 81 | + * he had trouble with building BMI calculator in Eve |
| 82 | + * TODO strangeloop spreadsheet |
| 83 | + |
| 84 | + |
| 85 | +* visual editor |
| 86 | + * constrains thinking |
| 87 | + * ask questions |
| 88 | + * where is data coming from? |
| 89 | + * server |
| 90 | + * are you going to send requests to some server? |
| 91 | + |
| 92 | + |
| 93 | +* visualize cyclejs window object as spreadsheets |
| 94 | + * spreadsheets as reactive programmign model |
| 95 | + * people used to spreadsheets are used to static data where you can manually update data which will then update data |
| 96 | + * there are some live data cells that are live, like stock market |
| 97 | + |
| 98 | + |
| 99 | +* value-change-over-time vs events |
| 100 | + * time -> real numbers (like age) |
| 101 | + * in cyclejs, this is also a stream |
| 102 | + * events (no current event) |
| 103 | + * birthdays are stream of events |
| 104 | + |
| 105 | +* signals (math.random) |
| 106 | + * represent its sampling by some event |
| 107 | + * it changes every nano second but we sample at some specific times |
| 108 | + * event, with value over time and you get another event |
| 109 | + * can also do proccessing in the signal world and then sample in different ways |
| 110 | + |
| 111 | + |
| 112 | +## Getting involved in CycleJS |
| 113 | + |
| 114 | +* gitter chat, really represents us. get their help in like a minute. |
| 115 | + |
| 116 | +* help-needed bug |
| 117 | + |
| 118 | +* readme has more info on getting started |
0 commit comments