[ Widget Preview ] Fix resolution for workspace "hosted" dependencies#176358
Merged
auto-submit[bot] merged 2 commits intomasterfrom Oct 2, 2025
Merged
[ Widget Preview ] Fix resolution for workspace "hosted" dependencies#176358auto-submit[bot] merged 2 commits intomasterfrom
auto-submit[bot] merged 2 commits intomasterfrom
Conversation
Projects within the same workspace can depend on each other without explicitly specifying path dependencies or dependency overrides using the following syntax: ``` dependencies: my_workspace_project: # No constraint or path ``` This is treated as a "hosted" dependency, which conflicts with the path dependencies used by the widget_preview_scaffold. This change introduces dependency_overrides for each package in the workspace watched by the widget previewer to allow for dependencies to be resolved correctly. Fixes #176018
Contributor
There was a problem hiding this comment.
Code Review
This pull request fixes an issue with resolving workspace dependencies in widget previews by adding dependency_overrides for workspace packages. The change is well-reasoned and includes a new regression test to cover this specific scenario. The implementation of the fix in preview_pubspec_builder.dart is correct. However, I've found a critical issue in the validation logic of the new regression test (regress_176018_test.dart), where the assertions are incorrect and would not properly validate the behavior. I've provided a code suggestion to fix the test.
packages/flutter_tools/test/commands.shard/hermetic/widget_preview/regress_176018_test.dart
Show resolved
Hide resolved
DanTup
approved these changes
Oct 2, 2025
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Oct 2, 2025
auto-submit bot
pushed a commit
to flutter/packages
that referenced
this pull request
Oct 2, 2025
flutter/flutter@7811e89...65aca36 2025-10-02 [email protected] Roll Skia from 257c1f94afaa to 05c1f5803415 (4 revisions) (flutter/flutter#176402) 2025-10-02 [email protected] [ Widget Preview ] Fix resolution for workspace "hosted" dependencies (flutter/flutter#176358) 2025-10-02 [email protected] Roll Skia from b5d8ae8d3410 to 257c1f94afaa (6 revisions) (flutter/flutter#176389) 2025-10-02 [email protected] Delete Skia-specific performance overlay implementation (flutter/flutter#176364) 2025-10-02 [email protected] Roll Fuchsia Linux SDK from 1Ai6VL4vb_GdGnWhg... to Vnoygds8HtDUvGLCK... (flutter/flutter#176381) 2025-10-01 [email protected] [ Widget Preview ] Persist "Filter by Selected File" toggle (flutter/flutter#176289) 2025-10-01 [email protected] Roll Skia from c44a36470d07 to b5d8ae8d3410 (5 revisions) (flutter/flutter#176367) 2025-10-01 [email protected] Reapply "Update the AccessibilityPlugin::Announce method to account f… (flutter/flutter#176107) 2025-10-01 [email protected] Roll Dart SDK from 8ffec1435cf3 to 4f90a06328cb (3 revisions) (flutter/flutter#176369) 2025-10-01 [email protected] [ Tool / l10n ] Fix issue where localization generator assumed current directory was the target project (flutter/flutter#175881) 2025-10-01 [email protected] Make sure that a DateRangePickerDialog doesn't crash in 0x0 environments (flutter/flutter#173754) 2025-10-01 [email protected] Make sure that a DrawerButton doesn't crash in 0x0 environment (flutter/flutter#172948) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
mboetger
pushed a commit
to mboetger/flutter
that referenced
this pull request
Oct 7, 2025
…flutter#176358) Projects within the same workspace can depend on each other without explicitly specifying path dependencies or dependency overrides using the following syntax: ``` dependencies: my_workspace_project: # No constraint or path ``` This is treated as a "hosted" dependency, which conflicts with the path dependencies used by the widget_preview_scaffold. This change introduces dependency_overrides for each package in the workspace watched by the widget previewer to allow for dependencies to be resolved correctly. Fixes flutter#176018
okorohelijah
pushed a commit
to okorohelijah/flutter
that referenced
this pull request
Oct 7, 2025
…flutter#176358) Projects within the same workspace can depend on each other without explicitly specifying path dependencies or dependency overrides using the following syntax: ``` dependencies: my_workspace_project: # No constraint or path ``` This is treated as a "hosted" dependency, which conflicts with the path dependencies used by the widget_preview_scaffold. This change introduces dependency_overrides for each package in the workspace watched by the widget previewer to allow for dependencies to be resolved correctly. Fixes flutter#176018
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 12, 2025
reidbaker
pushed a commit
to AbdeMohlbi/flutter
that referenced
this pull request
Dec 10, 2025
…flutter#176358) Projects within the same workspace can depend on each other without explicitly specifying path dependencies or dependency overrides using the following syntax: ``` dependencies: my_workspace_project: # No constraint or path ``` This is treated as a "hosted" dependency, which conflicts with the path dependencies used by the widget_preview_scaffold. This change introduces dependency_overrides for each package in the workspace watched by the widget previewer to allow for dependencies to be resolved correctly. Fixes flutter#176018
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Projects within the same workspace can depend on each other without explicitly specifying path dependencies or dependency overrides using the following syntax:
This is treated as a "hosted" dependency, which conflicts with the path dependencies used by the widget_preview_scaffold.
This change introduces dependency_overrides for each package in the workspace watched by the widget previewer to allow for dependencies to be resolved correctly.
Fixes #176018