Skip to content

[build_web_compilers] Standardize web app entrypoint selection - #5095

Merged
Markzipan merged 3 commits into
dart-lang:masterfrom
parlough:fix/web-entrypoint-priority
Sep 1, 2026
Merged

Markzipan merged 3 commits into
dart-lang:masterfrom
parlough:fix/web-entrypoint-priority

Conversation

@parlough

@parlough parlough commented Aug 28, 2026 •

Copy link
Copy Markdown
Member

Provides a stable order for finding web entrypoints when hot reload is enabled. This fixes an issue we were hitting with Jaspr serving where a test file with main was being preferred over an entrypoint in the web directory. Now the following priority is followed, while still ensuring they are entrypoints:

  1. The specified order of directories. So by default: web -> test -> example -> benchmark.
  2. Files closer to the root. So considers web/main.dart before web/a/main.dart.
  3. Files named main.dart.
  4. Files with an earlier alphanumeric value.

This also updates the web-assets-path option to support a YAML list of values rather than just a comma separated list and adds additional validation to the option.

@davidmorgan

Copy link
Copy Markdown
Contributor

@Markzipan

@Markzipan Markzipan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM - with a small change.

Note that the final changes to hot reload webdev-side are being added in this change: dart-lang/webdev#2867

after some DWDS-specific glue is landed in our SDK. This may delay formal hot reload support unless it's been handled separately in Jaspr.

Comment thread builder_pkgs/build_web_compilers/lib/src/web_entrypoint_marker_builder.dart Outdated
@parlough
parlough requested a review from Markzipan September 1, 2026 14:36
@parlough

parlough commented Sep 1, 2026 •

Copy link
Copy Markdown
Member Author

Thanks for taking a look! Updated.

Note the failing test seems to be an unrelated flake that's also timing out on main.

@Markzipan Markzipan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@Markzipan
Markzipan merged commit 47aba81 into dart-lang:master Sep 1, 2026
72 of 73 checks passed
@parlough
parlough deleted the fix/web-entrypoint-priority branch September 1, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants