-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed zed parser. Added domain models for better handler code. Fixed e2e test flakiness. Query is parsed async. Error messages are better.
- Loading branch information
Showing
157 changed files
with
2,560 additions
and
2,698 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1 +1 @@ | ||
16.10.0 | ||
18.18.2 |
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
|
@@ -14,5 +14,4 @@ | |
"type": "commonjs", | ||
"ignoreDynamic": true | ||
} | ||
|
||
} |
This file contains 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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 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 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,32 @@ | ||
import {toFieldPath} from "src/js/zed-script/toZedScript" | ||
|
||
export function fieldExprToName(expr) { | ||
let s = _fieldExprToName(expr) | ||
// const r = toFieldPath(s) | ||
return s | ||
} | ||
|
||
function _fieldExprToName(expr): string | string[] { | ||
switch (expr.kind) { | ||
case "BinaryExpr": | ||
if (expr.op == "." || expr.op == "[") { | ||
return [] | ||
.concat(_fieldExprToName(expr.lhs), _fieldExprToName(expr.rhs)) | ||
.filter((n) => n !== "this") | ||
} | ||
return "<not-a-field>" | ||
case "ID": | ||
return expr.name | ||
case "This": | ||
return "this" | ||
case "Primitive": | ||
return expr.text | ||
case "Call": | ||
var args = expr.args | ||
.map((e) => toFieldPath(_fieldExprToName(e))) | ||
.join(",") | ||
return `${expr.name}(${args})` | ||
default: | ||
return "<not-a-field>" | ||
} | ||
} |
This file contains 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 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,32 @@ | ||
export function createWaitForSelector(store) { | ||
return function waitForSelector( | ||
select, | ||
options: {signal?: AbortSignal} = {} | ||
) { | ||
let resolve | ||
let targetValue | ||
|
||
const unsubscribe = store.subscribe(() => { | ||
const state = store.getState() | ||
if (select(state) === targetValue) { | ||
unsubscribe() | ||
resolve() | ||
} | ||
}) | ||
|
||
let promise = new Promise((res, reject) => { | ||
resolve = res | ||
options.signal?.addEventListener("abort", () => { | ||
unsubscribe() | ||
reject(new DOMException("AbortError")) | ||
}) | ||
}) | ||
|
||
return { | ||
toReturn(value) { | ||
targetValue = value | ||
return promise | ||
}, | ||
} | ||
} | ||
} |
This file contains 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 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.