-
Notifications
You must be signed in to change notification settings - Fork 132
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
Remove JS Zed Query Parser #2972
Conversation
@jameskerr I think we should back out the changes to models/Program then merge this. |
test('parse a simple zed string', async ({ page }) => { | ||
await page.fill('input', 'zed := "world"'); | ||
await page.click('button'); | ||
await expect(page.locator('pre')).toContainText('"kind": "OpAssignment"'); |
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.
On the zed side of things we avoid not having tests that introspect the contents of the ast since this is often subject to change. I think I'd just have a test here that looked for a parser error and verifies the error message- something like put x :=
.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@jameskerr re @philrz's last comment. Instead of using the error message field returned by compile endpoint, I was thinking we could use It tells you where in the source the parse error occurred and we could pass that to Monaco and have it do the error message natively. |
When going over this PR on a Zoom earlier with @jameskerr I drilled down a bit on how this branch currently leverages:
An ongoing concern I've had for some time is that as more users start to use remote Zed lakes they may encounter difficult-to-debug problems when their local Zui and the remote Zed service have some kind of language/AST incompatibilities. I'm sure there's multiple ways we'll go about addressing this over time (e.g., I assume stricter API versioning could help here) but I've always got my eyes open to ways we can improve incrementally in the meantime. As @jameskerr confirmed, up until this change Zui has always depended on the local Zed parser that shipped with the app, so relying on the I set up an EC2 instance in AWS The summary of the findings:
The video shows the user experience in terms of visible delay in the app: Demo.mp4My conclusion: I think the change is worth making. Yes, speed is important, but I'd argue that correctness in catching/reporting errors is even more important, especially as we start adding more features over time that actually might change the contents of a pool. In terms of how I imagine remote lakes will be used, I'm guessing what I'm doing here with accessing a lake on the other side of the country will be less common, and users that do it will likely become accustomed to other unavoidable delays. I suspect more remote lakes will be "local" in nature, e.g., like our community zync users that I think are all in the same geographic region. Finally, if the observed latency gets to be a problem I could picture fancy optimizations we could do, e.g., have Zui compare what's returned by the @mattnibs: Do you have any opinions to add here? |
I am fine with using the current lake for the /compile endpoint. I can change the order of some of these operations to improve the speed if I know we are going to loose between 150 and 300 milliseconds on parsing. Also, would it be possible (or does this already happen?) to return the parsing error message and location information from the /query endpoint when you submit a bad query? I could also parse the query async to improve speed. The only reason for parsing first is to prevent adding to the history stack an invalid query entry. However, I could be hopeful that it will work, and if it does not, remove the entry from the history stack. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@@ -81,13 +81,29 @@ _Main Process Initializers_ | |||
|
|||
Code that needs to be run one time before the app starts up can be put in an initializer. An initializer is a file that lives in the folder `src/electron/initializers/`. It must export a function named _initialize(main)_ that takes the Main Object as its only argument. See the FAQ for an example of creating a new initializer. | |||
|
|||
_Query Session_ | |||
|
|||
This is a type of page that a tab can hold it the app. The page contains an editor pane, a results pane, and an inspector with various tabs related to querying data. These are session history, global history, data details, columns, and 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.
This is a type of page that a tab can hold it the app. The page contains an editor pane, a results pane, and an inspector with various tabs related to querying data. These are session history, global history, data details, columns, and more. | |
This is a type of page that a tab can hold in the app. The page contains an editor pane, a results pane, and an inspector with various tabs related to querying data. These are session history, global history, data details, columns, and more. |
Overview
Removes our dependency on the JS version of the Zed Query Parser.
Fixes #2843
Behavioral Changes:
Technical Changes
Side Effects
Tradeoffs
* A query is always pushed into history, even if there is an error in the query text.Do Later