-
Notifications
You must be signed in to change notification settings - Fork 29.8k
[ Widget Previews ] Add support for Pub Workspaces #171538
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
Conversation
Updates the widget previewer to properly handle previews defined across a workspace. This is effectively equivalent to displaying previews from multiple individual projects, which required a fairly significant rework to properly support: - resolving asset paths to the right project - loading assets across projects in the workspace - tracking changes to pubspec.yaml files across the workspace While making this change, it became apparent that we don't need to explicitly list the assets from the various projects explicitly in the scaffold's pubspec.yaml as they're automatically pulled in by adding those project's as dependencies and using the `package/$ASSET_PATH` format to load the assets from the scaffold. This allowed for the removal of a significant amount of logic related to building the scaffold's pubspec. Fixes #169268
| import '../../src/common.dart'; | ||
| import '../../src/context.dart'; | ||
|
|
||
| // TODO(bkonyi): test pubspec change detection for workspaces |
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.
These tests should be rewritten to utilize some of the utilities that have been added for testing widget preview projects. I'll do this in a follow up to avoid making this PR even larger.
jyameo
left a comment
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.
Overall LGTM! However, there are some test failures to note:
UnimplementedError: workspaceProjectsinwidget_preview_test.dart.- Mismatches between expected and actual URI/path formats in
preview_detector_graph_test.dart.
I swear I had run all the widget preview tests before uploading this... apparently not 😅 The failures should be fixed now. |
Updates the widget previewer to properly handle previews defined across a workspace. This is effectively equivalent to displaying previews from multiple individual projects, which required a fairly significant rework to properly support: - resolving asset paths to the right project - loading assets across projects in the workspace - tracking changes to pubspec.yaml files across the workspace While making this change, it became apparent that we don't need to explicitly list the assets from the various projects explicitly in the scaffold's pubspec.yaml as they're automatically pulled in by adding those project's as dependencies and using the `package/$ASSET_PATH` format to load the assets from the scaffold. This allowed for the removal of a significant amount of logic related to building the scaffold's pubspec. Fixes flutter#169268
Updates the widget previewer to properly handle previews defined across a workspace. This is effectively equivalent to displaying previews from multiple individual projects, which required a fairly significant rework to properly support: - resolving asset paths to the right project - loading assets across projects in the workspace - tracking changes to pubspec.yaml files across the workspace While making this change, it became apparent that we don't need to explicitly list the assets from the various projects explicitly in the scaffold's pubspec.yaml as they're automatically pulled in by adding those project's as dependencies and using the `package/$ASSET_PATH` format to load the assets from the scaffold. This allowed for the removal of a significant amount of logic related to building the scaffold's pubspec. Fixes flutter#169268
Updates the widget previewer to properly handle previews defined across a workspace. This is effectively equivalent to displaying previews from multiple individual projects, which required a fairly significant rework to properly support: - resolving asset paths to the right project - loading assets across projects in the workspace - tracking changes to pubspec.yaml files across the workspace While making this change, it became apparent that we don't need to explicitly list the assets from the various projects explicitly in the scaffold's pubspec.yaml as they're automatically pulled in by adding those project's as dependencies and using the `package/$ASSET_PATH` format to load the assets from the scaffold. This allowed for the removal of a significant amount of logic related to building the scaffold's pubspec. Fixes flutter#169268
Updates the widget previewer to properly handle previews defined across a workspace. This is effectively equivalent to displaying previews from multiple individual projects, which required a fairly significant rework to properly support:
While making this change, it became apparent that we don't need to explicitly list the assets from the various projects explicitly in the scaffold's pubspec.yaml as they're automatically pulled in by adding those project's as dependencies and using the
package/$ASSET_PATHformat to load the assets from the scaffold. This allowed for the removal of a significant amount of logic related to building the scaffold's pubspec.Fixes #169268