-
Notifications
You must be signed in to change notification settings - Fork 263
Runtime watchers #773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Runtime watchers #773
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
80381d1
Add transaction export, Exporter, Program.watch, and Watcher registry
joshuafcole 357fb3e
Mode the index file to point at bootstrap.ts
joshuafcole 2a9f18a
Less logging
joshuafcole 6134ba0
Get basic rendering working
joshuafcole 8df120e
Fix impossible removal bug
joshuafcole 9acd6f9
Update example to test crossy parent
joshuafcole 3fbf3bd
Sideport the dynamic add changes
joshuafcole f1a0107
Fix root removal + ignore used attrs
joshuafcole 4c11db7
Fix diff ordering in exporter
joshuafcole 7998640
Remove logging
joshuafcole 90ecb7a
Simpler example of the jeff issue
joshuafcole 8f5195b
Fix up type implementations for choose and union
ibdknox 243a234
Dont ignore count for special attributes in html watcher
joshuafcole 506d072
Propery crossy parent test
joshuafcole 60f76ec
remove the completely wrong deduping stuff and fix the actual bug we …
ibdknox f204e0f
Remove extraneous reset stuff
joshuafcole f1d8359
Merge with upstream
joshuafcole ccc60a1
Change the exporter to be per block vs per tag
joshuafcole d7aed46
add() should always push into dynamic fields
joshuafcole ad36faa
Clean up cruft
joshuafcole 1ec234d
Fix bug in maybeReverse that made 0 -> undefined
joshuafcole 7cf13ab
Remove extraneous block
joshuafcole a798847
Add sorted insertion
joshuafcole File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,95 @@ | ||
| import {Program} from "./runtime/dsl"; | ||
| import {Watcher} from "./watchers/watcher"; | ||
| import "./watchers/html"; | ||
|
|
||
| let prog = new Program("test"); | ||
| Watcher.attach("html", prog); | ||
|
|
||
| prog | ||
| .block("simple block", ({find, record, lib}) => { | ||
| let person = find("P"); | ||
| let potato = find("potato"); | ||
| let nameElem; | ||
| return [ | ||
| nameElem = record("html/element", {tagname: "span", text: person.name}), | ||
| record("html/element", {tagname: "section", potato}).add("child" + "ren", nameElem) | ||
| ] | ||
| }); | ||
|
|
||
| prog.test(0, [ | ||
| [2, "tag", "html/element"], | ||
| [2, "tagname", "div"], | ||
| [2, "children", 3], | ||
| [2, "sort", 1], | ||
|
|
||
| [3, "tag", "html/element"], | ||
| [3, "tagname", "span"], | ||
| [3, "text", "Woo hoo!"], | ||
| [3, "style", 4], | ||
|
|
||
| [4, "color", "red"], | ||
| [4, "background", "pink"], | ||
|
|
||
| [5, "tag", "html/element"], | ||
| [5, "tagname", "div"], | ||
| [5, "style", 6], | ||
| [5, "children", 7], | ||
| [5, "sort", 3], | ||
|
|
||
| [6, "border", "3px solid green"], | ||
|
|
||
| [7, "tag", "html/element"], | ||
| [7, "tagname", "span"], | ||
| [7, "text", "meep moop"], | ||
| ]); | ||
|
|
||
| prog.test(1, [ | ||
| [3, "style", 4, 0, -1] | ||
| ]); | ||
|
|
||
| prog.test(2, [ | ||
| [3, "style", 4, 0, 1], | ||
| [4, "font-size", "4em"], | ||
| [4, "background", "pink", 0, -1] | ||
| ]); | ||
|
|
||
| prog.test(3, [ | ||
| [8, "tag", "html/element"], | ||
| [8, "tagname", "div"], | ||
| [8, "style", 4], | ||
| [8, "text", "Jeff (from accounting)"], | ||
| [8, "sort", 0] | ||
| ]); | ||
|
|
||
| // prog | ||
| // .test(0, [ | ||
| // [1, "tag", "P"], | ||
| // [1, "name", "Jeff"], | ||
|
|
||
| // [2, "tag", "P"], | ||
| // [2, "name", "KERY"], | ||
|
|
||
| // [3, "tag", "P"], | ||
| // [3, "name", "RAB"], | ||
|
|
||
| // [4, "tag", "potato"], | ||
| // [4, "kind", "idaho"], | ||
|
|
||
| // [5, "tag", "potato"], | ||
| // [5, "kind", "irish gold"], | ||
|
|
||
| // ]); | ||
|
|
||
| // prog | ||
| // .test(1, [ | ||
| // [1, "tag", "P", 0, -1], | ||
| // [2, "tag", "P", 0, -1] | ||
|
|
||
| // ]); | ||
|
|
||
| // prog | ||
| // .test(2, [ | ||
| // [1, "tag", "P", 0, 1], | ||
| // ]); | ||
|
|
||
| console.log(prog); |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗑
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J/k, this tracks the nodeIds now that they aren't all awesome nodes.