Skip to content

devtools: Implement eager evaluation - #47527

Merged
mukilan merged 1 commit into
servo:mainfrom
freyacodes:eager-eval
Sep 1, 2026
Merged

mukilan merged 1 commit into
servo:mainfrom
freyacodes:eager-eval

Conversation

@freyacodes

@freyacodes freyacodes commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Adds support for eager evaluation, with the console evaluating code without side-effects as the user is typing. In eager mode, evaluation is aborted upon hitting effectful bytecode or conditionally upon native calls.

Known issues:

  • Calls to native code are currently assumed to always have side-effects (and therefore aborted), see the eagerDbg.onNativeCall hook
  • Firefox eagerly renders SyntaxError. Nominally these would be filtered out on the client, but this filter relies upon the error preview, which we don't support yet. This means that you get shown syntax errors as you type

Testing: Covered by new python tests
Fixes: Part of #39858

@freyacodes
freyacodes marked this pull request as ready for review August 28, 2026 10:53
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 28, 2026

@eerii eerii left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! :)

String,
PipelineId,
Option<String>,
bool,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this patch, but I do wonder if it would be helpful to turn some of this into enum structs instead of tuples, since they are getting quite big and it can be hard to know what each field represents. Specially something like SetBreakpoint.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this is getting unwieldy

try {
let completionValue;
if (frame) {
// <https://searchfox.org/firefox-main/source/js/src/doc/Debugger/Debugger.Frame.md#223>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sad that we have to link to the non-rendered version, but it seems like the page in the source docs has not been updated since 2017! And the other one is a broken link now. So not much we can do.

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Aug 31, 2026
@eerii eerii added A-devtools T-linux-devtools Do a try run on Linux of the devtools tests. and removed A-devtools labels Aug 31, 2026
@github-actions github-actions Bot removed the T-linux-devtools Do a try run on Linux of the devtools tests. label Aug 31, 2026
@github-actions

Copy link
Copy Markdown

🔨 Triggering try run (#33376145790) for Linux (Devtools Tests)

@github-actions

Copy link
Copy Markdown

✨ Try run (#33376145790) succeeded.

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 31, 2026
@freyacodes

Copy link
Copy Markdown
Member Author

Added the source attribution :)

@eerii
eerii enabled auto-merge August 31, 2026 13:38
@freyacodes

Copy link
Copy Markdown
Member Author

The CI seems to be having a bad day?

@eerii

eerii commented Aug 31, 2026

Copy link
Copy Markdown
Member

Yes, I tried restarting it a while ago and it doesn't seem to be working :( I'll ask

@mukilan
mukilan disabled auto-merge September 1, 2026 03:44
@mukilan
mukilan enabled auto-merge September 1, 2026 03:44
@mukilan
mukilan added this pull request to the merge queue Sep 1, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Sep 1, 2026
@mukilan

mukilan commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

I cancelled the long running job, but Github didn't recognized that as 'failed to merge'. I had to trigger the workflow again by using the 'Update with rebase' option in the UI. It seems it is now added to the merge queue.

Merged via the queue into servo:main with commit b4fdcaf Sep 1, 2026
33 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Sep 1, 2026
@freyacodes
freyacodes deleted the eager-eval branch September 1, 2026 12:37
RichardTjokroutomo pushed a commit to RichardTjokroutomo/servo that referenced this pull request Oct 6, 2026
Adds support for eager evaluation, with the console evaluating code
without side-effects as the user is typing. In eager mode, evaluation is
aborted upon hitting effectful bytecode or conditionally upon native
calls.

Known issues:
- Calls to native code are currently assumed to always have side-effects
(and therefore aborted), see the `eagerDbg.onNativeCall` hook
- Firefox eagerly renders `SyntaxError`. Nominally these would be
filtered out on the client, but this filter relies upon the `error`
preview, which we don't support yet. This means that you get shown
syntax errors as you type

Testing: Covered by new python tests
Fixes: Part of servo#39858

Signed-off-by: Freya Arbjerg <[email protected]>
Psychpsyo pushed a commit to Psychpsyo/servo that referenced this pull request Oct 12, 2026
Adds support for eager evaluation, with the console evaluating code
without side-effects as the user is typing. In eager mode, evaluation is
aborted upon hitting effectful bytecode or conditionally upon native
calls.

Known issues:
- Calls to native code are currently assumed to always have side-effects
(and therefore aborted), see the `eagerDbg.onNativeCall` hook
- Firefox eagerly renders `SyntaxError`. Nominally these would be
filtered out on the client, but this filter relies upon the `error`
preview, which we don't support yet. This means that you get shown
syntax errors as you type

Testing: Covered by new python tests
Fixes: Part of servo#39858

Signed-off-by: Freya Arbjerg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants