Commit Graph

9822 Commits

Author SHA1 Message Date
Nicholas Shahan
7e32a77210
[flutter_tools] Enable hot reload on the web (#169174)
[flutter_tools] Enable hot reload on the web

Update the defaults so hot reload is enabled on web development builds
by default.
This enables the use of a new module representation in the compiled
JavaScript.
Passing `--no-web-experimental-hot-reload` will disable the ability to
hot reload
and return to the AMD JavaScript module representation.

This change avoids enabling hot reload in the flutter drive tests since
they rely on
`-d web-server` which has known startup issues. When
https://github.com/dart-lang/sdk/issues/60289 is
resolved it should be safe to enable hot reload by default for the
`flutter drive`
tests.

Fixes: https://github.com/flutter/flutter/issues/167510
2025-06-02 23:13:50 +00:00
Matan Lurey
d4f60bddd2
Remove generateSyntheticPackages and code that invoked it. (#169893)
Towards https://github.com/flutter/flutter/issues/102983.
2025-06-02 23:12:38 +00:00
Victoria Ashworth
88bc2536d3
Update iOS tools (#169863)
Updates `libimobiledevice`, `libplist`, `openssl`, `usbmuxd` (renamed
`libusbmuxd`) to newest commits. Also adds `libimobiledeviceglue`, which
is a new dependency for `libimobiledevice`.

I confirmed they are all codesigned:
```
codesign -d /Users/vashworth/Development/flutter/bin/cache/artifacts/libusbmuxd/iproxy -vv
Executable=/Users/vashworth/Development/flutter/bin/cache/artifacts/libusbmuxd/iproxy
Identifier=iproxy
Format=Mach-O thin (x86_64)
CodeDirectory v=20500 size=466 flags=0x10000(runtime) hashes=4+7 location=embedded
Signature size=9048
Authority=Developer ID Application: FLUTTER.IO LLC (S8QB4VV633)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=May 29, 2025 at 8:19:14 PM
Info.plist=not bound
TeamIdentifier=S8QB4VV633
Runtime Version=15.2.0
Sealed Resources=none
Internal requirements count=1 size=168
```

Fixes https://github.com/flutter/flutter/issues/165656,
https://github.com/flutter/flutter/issues/42969

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-06-02 18:35:14 +00:00
Daco Harkes
ff2184fc8a
[native assets] Add error message for #169475 (#169866)
Bug:

* https://github.com/flutter/flutter/issues/169475

I don't want to skip building native assets and sweep the actual cause
of this under the rug. If native assets would be used, the app build
would succeed but accessing the assets would fail at runtime. It seems
the project path should always occur as a package root in the package
config json. So this is a state error.
2025-06-02 16:23:37 +00:00
flutter-pub-roller-bot
ead0a01bb9
Roll pub packages (#169865)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-06-02 16:13:02 +00:00
Victoria Ashworth
46b03c3529
Symlink SwiftPM plugins in the same directory (#168932)
This PR symlinks SwiftPM plugins in the same directory so that they're
relative to each other and the `FlutterGeneratedPluginSwiftPackage`.

This allows plugins to depend on each other via relative paths.

For example,

> Flutter/ephemeral/Packages/.packages/plugin_a --> symlink -->
/local/path/to/plugin_a
> Flutter/ephemeral/Packages/.packages/plugin_b --> symlink -->
/path/to/.pub-cache/plugin_b

Then in plugin_b's Package.swift, you can do the following to add a
dependency on plugin_a:
```swift
dependencies: [
  .package(name: "plugin_a", path: "../plugin_a"),
],
```

Addresses https://github.com/flutter/flutter/issues/166528 and
incremental change toward
https://github.com/flutter/flutter/issues/166489.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-06-02 16:11:06 +00:00
Ben Konyi
a63836aa2b
[ Widget Previews ] Remove deprecated desktop support (#169703)
Also cleans up non-verbose logging output to be less noisy.
2025-06-02 15:23:43 +00:00
gaaclarke
677e562560
[ios]: Warning for FlutterAppDelegate.window.rootViewController in launch functions (#169166)
fixes https://github.com/flutter/flutter/issues/169218

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Victoria Ashworth <15619084+vashworth@users.noreply.github.com>
2025-05-31 00:16:20 +00:00
Kevin Moore
bcfb87134b
[web] Pass the same JS flags to both stages of the compiler (#169730)
Fixes https://github.com/flutter/flutter/issues/169714
2025-05-31 00:14:31 +00:00
gaaclarke
3d8fa621c1
[Reland3] Implements UISceneDelegate dynamically w/ FlutterLaunchEngine (#169276) (#169365)
## **BREAKING CHANGE**

Adopting Apple's UISceneDelegate protocol shifts the initialization
order of apps. For the common cases we've made sure they will work
without change. The one case that will require a change is any app that
in `-[UIApplicateDelegate didFinishLaunchingWithOptions:]` assumes that
`UIApplicationDelegate.window.rootViewController` is a
`FlutterViewController` instance. Users should follow the [migration
guide](https://docs.google.com/document/d/16WsqYbANmhupw-gxGPQPZ9B3yz1YBIviS-N1UyIQNSE/edit?tab=t.0#heading=h.txry2otwqko3)
to update that usage.

## Changes since revert
It's been rebased onto the FlutterPluginRegistrant PR which was used for
migration. The dynamic selection of the UISceneDelegate has been
removed, instead there is a flutter tool migration to the Info.plist.

## Description
fixes: https://github.com/flutter/flutter/issues/167267

design doc:


https://docs.google.com/document/d/1ZfcQOs-UKRa9jsFG84-MTFeibZTLKCvPQLxF2eskx44/edit?tab=t.0

relands https://github.com/flutter/flutter/pull/168396 
relands https://github.com/flutter/flutter/pull/168914
relands https://github.com/flutter/flutter/pull/169276

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-05-30 20:57:40 +00:00
Matan Lurey
b6b1ae52ab
Better null-safe implementation of AssetTransformerEntry. (#169645)
Some small cleanups I had stashed while looking at
https://github.com/flutter/flutter/issues/168629.
2025-05-29 21:53:36 +00:00
Loïc Sharma
279f19161f
Let tests mock the list of feature flags (#169140)
This moves the tool's `allFeatures` global to
`FeatureFlags.allFeatures`.

In the future, this will be used by tests to mock the list of feature
flags and replace them with test flags in various states. See:
https://github.com/flutter/flutter/pull/168437

Part of: https://github.com/flutter/flutter/issues/167668

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-29 20:40:34 +00:00
Nicholas Shahan
422d8d2dad
[tests] Increase linux timeout and skip on others (#169627)
With this change the web.shard test suite runs all existing tests on all
platforms with the version of the web debug builds that is the flutter
tools default (does not support stateful hot reload).

The linux bot configuration will also run some of the tests using the
new web debug build (supports stateful hot reload). The timeout has been
increased for this configuration to allow the additional tests to run to
completion.

The mac and windows configurations skip all tests for the new web debug
builds.

In the future the new build output will become the flutter tools default
and the balance of where the tests tests are run will flip until the
ability to opt out of the new build output is removed.

This change is not ideal because we are still not fully testing all
features with the two versions of the web debug builds that are
available to users. If given the opportunity we should add additional
bot configurations to run all the tests with the output that supports
stateful hot reload.

Fixes: https://github.com/flutter/flutter/issues/169304
Issue: https://github.com/flutter/flutter/issues/169634
2025-05-29 19:00:57 +00:00
Victoria Ashworth
fe1c9d61a7
Validate build configuration during Xcode build phase (#169395)
You can run iOS/macOS Flutter apps through either the Flutter CLI or
Xcode. However, it's often required to first run the Flutter CLI to
generate required files and settings. Some of these settings/files (like
dev dependencies) are specific to the build mode. However, you can
change the build mode through Xcode too. When you change the build mode
through Xcode, the Flutter-generated files and setting may not be
correct.

This PR checks if the current build mode matches the one last used by
the Flutter CLI. If it doesn't, it'll print a warning like this:

![Screenshot 2025-05-23 at 5 14
58 PM](https://github.com/user-attachments/assets/47d15cc4-f05d-4034-8be6-67f37828aa61)

If the build action is `install`, which indicates the app is being built
for distribution, this will print as an error and fail the build:

![Screenshot 2025-05-23 at 5 16
12 PM](https://github.com/user-attachments/assets/339b65bd-6425-4595-b26b-a60c722bbcf9)


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-29 19:00:56 +00:00
René Kilczan
ae11f77f20
Fix the "Missing ExternalProject for :" error (#168403)
Fix the "Missing ExternalProject for :" error

This fixes #168296

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-29 17:51:19 +00:00
Kevin Moore
a7bab0fe86
[web] Pass the same optimization level to both stages of JS compiler (#169642)
Ensures that late variables names are cleaned up

Fixes https://github.com/flutter/flutter/issues/134423
2025-05-29 17:35:29 +00:00
Kevin Moore
f2625754b3
Fix minify logic (#169607)
It's meant to be ignored unless explicitly set.

Introduced in
cb3150f998
2025-05-28 23:52:39 +00:00
Matan Lurey
8e8cb92553
Roll forward: "Initialize default-app-flavor" (#169298) (#169602)
Closes https://github.com/flutter/flutter/issues/169598 (which explains
the integration test failure).
Closes https://github.com/flutter/flutter/issues/169160.
Closes https://github.com/flutter/flutter/issues/165803.

This is the only diff from 5d013c73ba:
```diff
diff --git a/packages/flutter_tools/lib/src/build_system/targets/common.dart b/packages/flutter_tools/lib/src/build_system/targets/common.dart
index 61583210e47..67731019a05 100644
--- a/packages/flutter_tools/lib/src/build_system/targets/common.dart
+++ b/packages/flutter_tools/lib/src/build_system/targets/common.dart
@@ -308,10 +308,18 @@ class KernelSnapshot extends Target {
     if (flavor == null) {
       return;
     }
-    if (!dartDefines.any((String element) => element.startsWith(kAppFlavor))) {
-      // If the flavor is not already in the dart defines, add it.
-      dartDefines.add('$kAppFlavor=$flavor');
-    }
+
+    // It is possible there is a flavor already in dartDefines, from another
+    // part of the build process, but this should take precedence as it happens
+    // last (xcodebuild execution).
+    //
+    // See https://github.com/flutter/flutter/issues/169598.
+
+    // If the flavor is already in the dart defines, remove it.
+    dartDefines.removeWhere((String define) => define.startsWith(kAppFlavor));
+
+    // Then, add it to the end.
+    dartDefines.add('$kAppFlavor=$flavor');
   }
 }
 ```
2025-05-28 20:15:01 +00:00
Alex Li
e8366e3334
🐛 Use consist slashes when generating dep files (#169570)
Continue with https://github.com/flutter/flutter/pull/169467. I've
noticed that paths in the depfile on Windows are generated with
non-normalized paths. This PR normalizes every single file path before
putting them into the output.

This might also fix https://github.com/flutter/flutter/issues/163591 as
a root cause and can be easily cherry-picked.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-28 15:59:20 +00:00
Kevin Moore
c08e9dff68
Manually update vector_math package (#169476)
Includes fixes and deprecations that will allow us to improve
performance.
2025-05-28 15:55:01 +00:00
auto-submit[bot]
5d013c73ba
Reverts "Initialize default-flavor in FlutterCommand, adds integration test. (#169298)" (#169581)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#169298
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Broke mac/iOS integration tests.
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: matanlurey
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {vashworth, bkonyi}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
Closes https://github.com/flutter/flutter/issues/169160.
Closes https://github.com/flutter/flutter/issues/165803.
<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-05-28 12:35:47 +00:00
Matan Lurey
5759401447
Initialize default-flavor in FlutterCommand, adds integration test. (#169298)
Closes https://github.com/flutter/flutter/issues/169160.
Closes https://github.com/flutter/flutter/issues/165803.
2025-05-28 05:53:23 +00:00
Srujan Gaddam
973701688c
Set pause_isolates_on_start flag if --start-paused (#169392)
This enables breakpoint management for hot restart and hot reload.
--start-paused is passed by VS code.

Also fixes a small issue where we're not passing the isolate ID when hot
reloading. It doesn't matter what we pass as there's only one isolate,
but we should keep consistent and use the isolate ID that already
exists.

https://github.com/dart-lang/sdk/issues/60186

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-05-27 17:16:04 +00:00
Alex Li
4e75d56bda
🐛 Normalize generated file paths for the l10n generator (#169467)
Multiple places use non-normalized file paths when generating the
localization files.

The PR normalizes file paths when generating the file list JSON file and
the dependency file.

Fixes https://github.com/flutter/flutter/issues/163591

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-26 23:25:42 +00:00
Ben Konyi
a6205c3a66
Roll package:dds to 5.0.2 (#169471)
Fixes https://github.com/flutter/flutter/issues/156793
2025-05-26 18:43:10 +00:00
Matan Lurey
151011f7b4
Use .flutter-plugins-dependencies for crash reporting. (#169319)
Closes https://github.com/flutter/flutter/issues/169318.
2025-05-26 18:13:29 +00:00
Matan Lurey
6d8184e21e
Remove now disabled code that would generate .flutter-plugins. (#169320)
As of https://github.com/flutter/flutter/pull/169283 it's impossible for
the `.flutter-plugins` file to exist outside of unit tests.

This removes the unit tests too :)
2025-05-26 18:13:03 +00:00
munrocket
a9e9ff9eb0
Precise browser resizing with integration_test and driver (#160678)
Fixes #136109 P2
Related #148028 P1

Roadmap:
- [x] find why not working (described in #136109)
- [x] create new API with backward compatibility
(`--browser-dimension=393×852@3`)
- [x] fix edge cases
- [x] internal testing
- [x] add documentation (flutter drive -h)

This PR:
- Fixes Chrome bug from dart side
- Adds pixelRatio mobile emulation in web
- Adds new notation: 393,852 -> 393×852[@1]
- Leaves previous behavior as it was, so 393,852 will give wrong size
until Chrome will fix it. But you can use 393×852@1.

---------

Co-authored-by: Mouad Debbar <mdebbar@google.com>
2025-05-26 16:58:11 +00:00
Matan Lurey
36275e1e71
Add /coverage/ to .gitignore.tmp (#169387)
Closes https://github.com/flutter/flutter/issues/166909.

Made `/build/` consistent while I was here.
2025-05-26 16:55:08 +00:00
Matan Lurey
b7566a19ee
Make test output with encoded dart-defines=... human readable. (#169353)
Closes https://github.com/flutter/flutter/issues/169350.
2025-05-26 16:53:09 +00:00
Matan Lurey
107601f338
Use at most PROC~/2 tasks to transform assets. (#169386)
Towards https://github.com/flutter/flutter/issues/168629.

I could imagine plumbing a `--concurrency` flag down from `flutter
build` to give users more control.
2025-05-26 16:51:21 +00:00
Valentin Vignal
4f83e03136
Forward exit code from dart test to flutter test (#168604)
Fixes https://github.com/flutter/flutter/issues/100467

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-26 16:51:20 +00:00
Mikhail Novoseltsev
742141a8f3
Fix warning when building for macOS desktop (#165996)
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

This PR resolves warning when building macOS app in environments with
multiple available destinations (i.e. arm Macs with Rosetta).

| | Debug | Release | Profile |
|---|---|---|---|
| **Before** | <img width="657" alt="image"
src="https://github.com/user-attachments/assets/5207f2cc-2785-4bef-8eb0-e9a5a7431c91"
/> | <img width="699" alt="image"
src="https://github.com/user-attachments/assets/31f38373-adf9-4797-982d-782569be0681"
/> | <img width="699" alt="image"
src="https://github.com/user-attachments/assets/be1432f9-0668-44b9-b75e-ae4a56c0ff6e"
/> |
| **After** | <img width="672" alt="image"
src="https://github.com/user-attachments/assets/62f3b37b-8461-4274-b9be-53df22bec82d"
/> | <img width="672" alt="image"
src="https://github.com/user-attachments/assets/7c0489e7-0f7f-4498-b9d2-6d566722a05a"
/> | <img width="672" alt="image"
src="https://github.com/user-attachments/assets/d0a3e065-3ae7-4d53-beb5-d2a96aa01aea"
/> |


For release/profile builds `generic/platform=macOS` was chosen because
these configurations are "fat" (includes all arches) so it is a
preferred way of building device-agnostic actions such as `xcodebuild
build`, as per `xcodebuild` documentation.

fixes #86590 

Also, kudos to @zhibisora. This PR is heavily inspired by
https://github.com/flutter/flutter/pull/148920. Although, I failed to
properly rebase it onto current master (you know, monorepo merge and
format changes).


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-26 14:58:08 +00:00
auto-submit[bot]
4372bfbc6c
Reverts "Add workspace (#169451)" (#169468)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#169451
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Broke a number of post-submit tests
(ios_app_extension, packages_autoroller).
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: mosuem
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {matanlurey}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
Reland after #169357.

Switch Flutter to use pub workspaces as a preparation to unpin selected
packages.

Assumptions:

1. No packages in this repository are published to pub.dev --> We can
use `any` dependencies in most local pubspecs, as the global constraint
defines the version. An exception are the packages used outside of this
repo with an `sdk` dependency, namely `flutter_localizations`,
`flutter_test`, and `flutter`.
2. The "universes" `{flutter_tools}` and `{flutter,
flutter_localizations, flutter_goldens}` can use different packages
versions, as they are not resolved together. --> We do not need to
upgrade them in sync, we can first do one "universe", then the other.

Based on these assumptions, we use
https://github.com/mosuem/pubspec_merger.dart to merge all packages in
the `flutter` universe into a top-level pub workspace.

The `flutter` and `flutter_tools` workspaces being separate also ensures
that changes to `flutter` will not inadvertently break `flutter_tools`,
with not-so-nice consequences for our users which would be unable to run
`flutter upgrade`.

There is a third "top-level" pubspec besides `./pubspec.yaml` and
`packages/flutter_tools/pubspec.yaml`, namely
`packages/flutter_tools/.../widget_preview_scaffold/pubspec.yaml`. This
is an artifact due to it living under `flutter_tools`, so it can't be
part of the `./pubspec.yaml` workspace. Moving it would be a larger
change, and out of the scope of this PR.

This required a rewrite of the update-packages tool, but the main
functionality stays the same, as well as the argument names, to ensure a
seamless transition.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-05-26 14:07:27 +00:00
Moritz
3a0897a336
Add workspace (#169451)
Reland after #169357.

Switch Flutter to use pub workspaces as a preparation to unpin selected
packages.

Assumptions:

1. No packages in this repository are published to pub.dev --> We can
use `any` dependencies in most local pubspecs, as the global constraint
defines the version. An exception are the packages used outside of this
repo with an `sdk` dependency, namely `flutter_localizations`,
`flutter_test`, and `flutter`.
2. The "universes" `{flutter_tools}` and `{flutter,
flutter_localizations, flutter_goldens}` can use different packages
versions, as they are not resolved together. --> We do not need to
upgrade them in sync, we can first do one "universe", then the other.

Based on these assumptions, we use
https://github.com/mosuem/pubspec_merger.dart to merge all packages in
the `flutter` universe into a top-level pub workspace.

The `flutter` and `flutter_tools` workspaces being separate also ensures
that changes to `flutter` will not inadvertently break `flutter_tools`,
with not-so-nice consequences for our users which would be unable to run
`flutter upgrade`.

There is a third "top-level" pubspec besides `./pubspec.yaml` and
`packages/flutter_tools/pubspec.yaml`, namely
`packages/flutter_tools/.../widget_preview_scaffold/pubspec.yaml`. This
is an artifact due to it living under `flutter_tools`, so it can't be
part of the `./pubspec.yaml` workspace. Moving it would be a larger
change, and out of the scope of this PR.

This required a rewrite of the update-packages tool, but the main
functionality stays the same, as well as the argument names, to ensure a
seamless transition.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-26 12:46:53 +00:00
Ben Konyi
b2b4fb5cbf
Start removing Observatory support and references (#169216)
This change removes references to Observatory, including:

 - Deprecated flags
 - Deprecated embedder APIs
 - Outdated documentation
 - Documentation instances where "VM service" should have been used
 - Incorrectly named tests / directories

As a part of this change, `--serve-observatory` is no longer a valid
flag.

Observatory is still available for now via the `_serveObservatory` RPC,
but will be removed in a follow up PR once we've prepared for breakages
in G3.

Work towards https://github.com/dart-lang/sdk/issues/50233

FYI @a-siva
2025-05-24 00:00:30 +00:00
Matan Lurey
5f99c893b3
Remove handling of the legacy .flutter-plugins file in PluginHandler.kt. (#169317)
As of https://github.com/flutter/flutter/pull/169283 it's impossible for
the `.flutter-plugins` file to exist outside of unit tests.
2025-05-23 17:02:02 +00:00
Fré Dumazy
171e272cf7
Use baseUri of WebAssetServer for reload_scripts.json (#169267)
This allows embedded Flutter Web apps, hosted on a different URL than
the host app, to hot reload the correct files.

This fixes issues mentioned in:
- https://github.com/dart-lang/sdk/issues/60776
-
https://github.com/flutter/flutter/issues/88434#issuecomment-2888413942

It specifically allows you to use hot reload when debugging an embedded
Flutter Web app, running in the spawned Chrome browser via the `-d
chrome` flag, as mentioned in
https://github.com/dart-lang/sdk/issues/60776#issuecomment-2900498970

## Result

This would result in the following `reload_scripts.json` for an embedded
Flutter web app, running on `localhost:8081`:
```json
[{
    "src": "http://localhost:8081/packages/web_hot_reload/main.dart.lib.js",
    "libraries": ["package:web_hot_reload/main.dart"]
}]
```

## Normal Flutter Web apps

This also adds the baseUri to the maps for normal Flutter Web apps, for
example:
```json
[{
    "src": "http://localhost:54609/packages/web_hot_reload/main.dart.lib.js",
    "libraries": ["package:web_hot_reload/main.dart"]
}]
```
instead of the previous:
```json
[{
    "src": "packages/web_hot_reload/main.dart.lib.js",
    "libraries": ["package:web_hot_reload/main.dart"]
}]
```

While both actually work, I'm not sure if there might be cases in which
this would have another side effect.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-23 17:02:00 +00:00
auto-submit[bot]
e0c42c6e38
Reverts "Use pub workspace (#168662)" (#169357)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#168662
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Broke integration tests that do not run on
presubmit:

-
https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_arm64%20macos_chrome_dev_mode/8715/overview
-
https://ci.chromium.org/ui/p/flutter/builders/prod/Linux_pixel_7pro%20linux_chrome_dev_mode/7617/overview
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: mosuem
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {matanlurey}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
Switch Flutter to use pub workspaces as a preparation to unpin selected
packages.

Assumptions:

1. No packages in this repository are published to pub.dev --> We can
use `any` dependencies in most local pubspecs, as the global constraint
defines the version. An exception are the packages used outside of this
repo with an `sdk` dependency, namely `flutter_localizations`,
`flutter_test`, and `flutter`.
2. The "universes" `{flutter_tools}` and `{flutter,
flutter_localizations, flutter_goldens}` can use different packages
versions, as they are not resolved together. --> We do not need to
upgrade them in sync, we can first do one "universe", then the other.

Based on these assumptions, we use
https://github.com/mosuem/pubspec_merger.dart to merge all packages in
the `flutter` universe into a top-level pub workspace.

The `flutter` and `flutter_tools` workspaces being separate also ensures
that changes to `flutter` will not inadvertently break `flutter_tools`,
with not-so-nice consequences for our users which would be unable to run
`flutter upgrade`.

There is a third "top-level" pubspec besides `./pubspec.yaml` and
`packages/flutter_tools/pubspec.yaml`, namely
`packages/flutter_tools/.../widget_preview_scaffold/pubspec.yaml`. This
is an artifact due to it living under `flutter_tools`, so it can't be
part of the `./pubspec.yaml` workspace. Moving it would be a larger
change, and out of the scope of this PR.

This required a rewrite of the update-packages tool, but the main
functionality stays the same, as well as the argument names, to ensure a
seamless transition.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-05-23 16:00:19 +00:00
Moritz
9a1dc1bd96
Use pub workspace (#168662)
Switch Flutter to use pub workspaces as a preparation to unpin selected
packages.

Assumptions:

1. No packages in this repository are published to pub.dev --> We can
use `any` dependencies in most local pubspecs, as the global constraint
defines the version. An exception are the packages used outside of this
repo with an `sdk` dependency, namely `flutter_localizations`,
`flutter_test`, and `flutter`.
2. The "universes" `{flutter_tools}` and `{flutter,
flutter_localizations, flutter_goldens}` can use different packages
versions, as they are not resolved together. --> We do not need to
upgrade them in sync, we can first do one "universe", then the other.

Based on these assumptions, we use
https://github.com/mosuem/pubspec_merger.dart to merge all packages in
the `flutter` universe into a top-level pub workspace.

The `flutter` and `flutter_tools` workspaces being separate also ensures
that changes to `flutter` will not inadvertently break `flutter_tools`,
with not-so-nice consequences for our users which would be unable to run
`flutter upgrade`.

There is a third "top-level" pubspec besides `./pubspec.yaml` and
`packages/flutter_tools/pubspec.yaml`, namely
`packages/flutter_tools/.../widget_preview_scaffold/pubspec.yaml`. This
is an artifact due to it living under `flutter_tools`, so it can't be
part of the `./pubspec.yaml` workspace. Moving it would be a larger
change, and out of the scope of this PR.

This required a rewrite of the update-packages tool, but the main
functionality stays the same, as well as the argument names, to ensure a
seamless transition.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-23 15:01:19 +00:00
Matan Lurey
e529d32dbf
Remove patching of package_config.json from Flutter Pub wrapper. (#169306)
This PR removes the mechanics around `generateSyntheticPackage` from
Flutter's `pub` wrapper (`DefaultPub`).

The feature it supported (`package:flutter_gen`) was deprecated (opt-in
3.29, opt-out 3.32) and is now being removed:


https://docs.flutter.dev/release/breaking-changes/flutter-generate-i10n-source

---

One integration test (`flutter_gen_test.dart`) will fail at this PR
until it is deleted in (pending)
https://github.com/flutter/flutter/pull/169283.

/cc @sigurdm yay!
2025-05-23 04:15:14 +00:00
Danny Tuppeny
c8d620e665
Unpin test/test_core/test_api packages (#169198)
These packages were recently pinned (in
https://github.com/flutter/flutter/pull/168916) due to a bug
(https://github.com/dart-lang/test/issues/2498).

That bug was fixed and new versions of the test packages published. This
change unpins and lets them upgrade to the fixed version.
2025-05-22 23:15:08 +00:00
Matan Lurey
9528c1849e
Disable the ability to opt-out of explicit-package-dependencies. (#169283)
This feature landed opt-in in 3.29 and opt-out in 3.32:


https://docs.flutter.dev/release/breaking-changes/flutter-generate-i10n-source

In this PR, we remove the ability to use `flutter config
--no-enable-explicit-package-dependencies`, and remove all places that
opt-in to the flag (which are currently NOPs). Follow-up PRs will
refactor tests relying on the older behavior, and then finally remove
`package:flutter_gen` and the `.flutter-plugins` (legacy format) file
guarded by this flag.
2025-05-22 21:42:50 +00:00
Matan Lurey
64894be90a
Skip {PLAT}_web_tools_test#expression_evaluation_*_test.dart, turning tree 🔴 (#169305)
P0 filed to restore: https://github.com/flutter/flutter/issues/169304,
these tests take 20m+ on Linux docs causing timeouts.
2025-05-22 20:08:01 +00:00
Matan Lurey
bb14ef665f
Update tool-internal generateLocalizations...() to never use synthetic (flutter_gen) packages (#169285)
Essentially this PR is
`s/getSyntheticGeneratedFileContent/getGeneratedFileContent` for a
particular test suite.

Made one non-test change (`bool useSyntheticPackage = false`) that
in-practice should be a NOP, mostly so I could catch (and remove) cases
where the default argument was already being passed-in. A follow-up PR
will continue to remove the synthetic package support features (and
refactor or remove tests where necessary).
2025-05-22 18:31:35 +00:00
Kevin Moore
cb3150f998
[tool] Add --no-minify flag to JS Compiler (#169102)
Also hides (behind verbose) dump info and frequency minify flags
2025-05-22 16:32:50 +00:00
Daco Harkes
534b250a56
[native assets] Graduate to preview (#169194)
This PR enables native assets on the main and dev channel by default,
and make native assets available on the beta channel.

This PR removes the flag from invocations.

The helper packages (`package:hooks` and `package:code_assets`) will
stay 0.x for now, until the SDK constraint can be bumped to a beta
release and we're happy with the Dart API.

Corresponding Dart CL:
https://dart-review.googlesource.com/c/sdk/+/429920

Issue:

* https://github.com/flutter/flutter/issues/129757

Project: https://github.com/orgs/dart-lang/projects/99/
2025-05-21 16:54:42 +00:00
Polina Cherkasova
61fe9b6b67
Unpin leak_tracker. (#169079)
Now, when leak_tracker bots are stable, leak_tracker can be unpinned.
2025-05-21 14:12:01 +00:00
Matan Lurey
5458f42782
Remove isExplicitPackageDependenciesEnabled: true, it is the default. (#169156)
This flag has been enabled by default for quite some time in `master`,
and in the current `stable`.

This is the first of many PRs to get rid of the flag and the deprecated
code it is guarding.
2025-05-21 04:26:10 +00:00
flutter-pub-roller-bot
cf1004028c
Roll pub packages (#169181)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-05-21 03:22:27 +00:00