Skip to content

[dwds] Wait for scripts to be parsed on a hot restart and publish DWDS 25.0.0 #2667

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 8 commits into from
Aug 13, 2025

Conversation

srujzs
Copy link
Contributor

@srujzs srujzs commented Aug 11, 2025

Like #2640, we should wait until scripts are parsed before continuing a hot restart. Otherwise, metadata can be stale and breakpoints may be placed in the wrong files.

For now, we only do this in the DDC library bundle format as we don't have a way to fetch the changed libraries in the AMD format.

  • hotReloadSourcesUri is repurposed to be reloadedSourcesUri, which is a breaking change. This file is now used for both hot restart and hot reload to detail the changed files across either.
  • Injected client is changed to return the mapping within this uri when a hot reload is executed.
  • Completer is added to ChromeProxyService to wait until all scripts are parsed before recreating the isolate, which will reinitialize all metadata.
  • Fix a preexisting race condition where we don't listen for a kIsolateStart event early enough.

This should help fix the Windows flakes for hot_restart_breakpoints_test.dart.

srujzs added 2 commits August 11, 2025 14:17
…S 25.0.0

Like dart-lang#2640, we
should wait until scripts are parsed before continuing a hot restart.
Otherwise, metadata can be stale and breakpoints may be placed in the
wrong files.

For now, we only do this in the DDC library bundle format as we don't
have a way to fetch the changed libraries in the AMD format.

- hotReloadSourcesUri is repurposed to be reloadedSourcesUri, which is
a breaking change. This file is now used for both hot restart and hot
reload to detail the changed files across either.
- Injected client is changed to return the mapping within this uri when
a hot reload is executed.
- Completer is added to ChromeProxyService to wait until all scripts are
parsed before recreating the isolate, which will reinitialize all metadata.
- Fix a preexisting race condition where we don't listen for a kIsolateStart
event early enough.

This should help fix the Windows flakes for hot_restart_breakpoints_test.dart.
Copy link
Contributor

@jyameo jyameo left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks Srujan

Copy link
Contributor

@nshahan nshahan left a comment

Choose a reason for hiding this comment

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

Let's coordinate on publishing because I have some changes I want in v25.0.0 as well.

@nshahan
Copy link
Contributor

nshahan commented Aug 12, 2025

FYI my change that I want to include in v25.0.0: #2660

@srujzs srujzs merged commit c0492f1 into dart-lang:main Aug 13, 2025
85 of 86 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants