Skip to content

Conversation

@salemiranloye
Copy link
Contributor

@salemiranloye salemiranloye commented Jul 15, 2025

Adding a development Proxy and dedicated Web configuration File

Flutter's current web development configuration relies on CLI arguments and does not have a development proxy. This PR adds a development proxy to flutter and a designated web_dev_config.yaml where web configuration settings are loaded from.

Issues:
#170834

Document:
HERE

Pre-launch Checklist

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

Co-authored-by: Sydney Bao [email protected]
Co-authored by: Salem Iranloye [email protected]

@github-actions github-actions bot added tool Affects the "flutter" command-line tool. See also t: labels. framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Jul 15, 2025
@salemiranloye salemiranloye force-pushed the web_dev_proxy branch 2 times, most recently from c9207cd to d801b66 Compare July 16, 2025 00:09
@dkwingsmt dkwingsmt removed framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Jul 16, 2025
@dkwingsmt dkwingsmt requested a review from kevmoo July 16, 2025 18:18
@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Jul 16, 2025
@salemiranloye salemiranloye force-pushed the web_dev_proxy branch 2 times, most recently from 490877e to 8404260 Compare July 17, 2025 20:18
@github-actions github-actions bot removed framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Jul 17, 2025
@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Jul 21, 2025
@github-actions github-actions bot removed framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Jul 21, 2025
@salemiranloye salemiranloye force-pushed the web_dev_proxy branch 5 times, most recently from 967902a to 29ce6c1 Compare July 28, 2025 17:02
Copy link
Member

@ditman ditman left a comment

Choose a reason for hiding this comment

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

I'm happy with how this turned out and am approving, but please don't merge until @bkonyi approves!

Copy link
Contributor

@bkonyi bkonyi left a comment

Choose a reason for hiding this comment

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

Just a couple of minor comments that wouldn't be worth blocking this PR on, but would be great to clean up if you've got the time.

LGTM and thanks for all the hard work! 🥳

final YamlList? proxyList = _validateType<YamlList>(value: yaml[_kProxy], fieldName: _kProxy);
final proxyRules = <ProxyRule>[];
if (proxyList != null) {
for (final Object? item in proxyList) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: this may be less verbose:

  final proxyRules = <ProxyRule>[
    ...?proxyList
        ?.whereType<YamlMap>()
        .map((e) => ProxyRule.fromYaml(e, logger))
        .nonNulls,
  ];

Copy link
Contributor

Choose a reason for hiding this comment

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

done!

}

final YamlList? proxyList = _validateType<YamlList>(value: yaml[_kProxy], fieldName: _kProxy);
final proxyRules = <ProxyRule>[];
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I think this would be less verbose:

  final proxyRules = <ProxyRule>[
    ...?proxyList
        ?.whereType<YamlMap>()
        .map((e) => ProxyRule.fromYaml(e, logger))
        .nonNulls,
  ];

Copy link
Contributor

Choose a reason for hiding this comment

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

done!

return null;
} else if (target == null || target.isEmpty) {
effectiveLogger.printError(
'${ProxyRule._kLogEntryPrefix} Invalid ${ProxyRule._kTarget} for ${ProxyRule._kRegex}: $regex. ${ProxyRule._kTarget} cannot be null',
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: can we split these log messages across multiple lines?

@kevmoo kevmoo added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 7, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Aug 7, 2025
Merged via the queue into flutter:master with commit 796c62b Aug 7, 2025
142 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 8, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Aug 8, 2025
flutter/flutter@92a6bfb...3821790

2025-08-08 [email protected] Use LLDB as the default debugging method for iOS 17+ and Xcode 26+ (flutter/flutter#173443)
2025-08-08 [email protected] Roll Fuchsia Linux SDK from i4vsuEGyP8Xeb5tiy... to HclTm0V8hgSpfqmtG... (flutter/flutter#173462)
2025-08-08 [email protected] Support launching a HTTPS URL (flutter/flutter#164720)
2025-08-08 [email protected] Roll Dart SDK from c48772a79e1f to 4b7b565eb468 (1 revision) (flutter/flutter#173454)
2025-08-08 [email protected] Roll Dart SDK from ba58b96a80d7 to c48772a79e1f (3 revisions) (flutter/flutter#173451)
2025-08-07 [email protected] Web dev proxy (flutter/flutter#172175)
2025-08-07 [email protected] Roll ICU from b929596baebf to 1b2e3e8a421e (7 revisions) (flutter/flutter#173436)
2025-08-07 [email protected] [A11y] TextField prefix icon and suffix icon create a sibling node' (flutter/flutter#173312)
2025-08-07 [email protected] [Android templates] Remove jetifier usage (flutter/flutter#173431)
2025-08-07 [email protected] Remove a couple of asserts from display_list_unittest (flutter/flutter#173381)
2025-08-07 [email protected] Fix ScaffoldGeometry null scale with noAnimation FAB (flutter/flutter#172914)
2025-08-07 [email protected] Prepare for iOS debugging with lldb and devicectl (flutter/flutter#173417)
2025-08-07 [email protected] Fix `ReorderableList` proxy animation for partial drag-back (flutter/flutter#172380)
2025-08-07 [email protected] [ios26]Do not report error for Info.plist key not found (flutter/flutter#172913)
2025-08-07 [email protected] Manual roll to 3.10.0-75.1.beta (flutter/flutter#173423)
2025-08-07 [email protected] [web] add --static-assets-url argument to build web (flutter/flutter#171638)
2025-08-07 [email protected] Adds deprecation for impeller opt out on android (flutter/flutter#173375)

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],[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
@woprandi
Copy link
Contributor

I'm very intestered so I'd like to give it a try but the basic example throw an error :

server:
  proxy: 
    - target: "https://localhost:3000"
      source: "/api/"

[ProxyRule] Invalid proxy rule in YAML: {target: https://localhost:3000, source: /api/}

The linked DOC seems outdated

@mdebbar
Copy link
Contributor

mdebbar commented Aug 11, 2025

@woprandi I'm assuming you are referring to the Google Doc, which is supposed to be a design doc and not final documentation.

Before this goes into a stable flutter release, we'll write official documentation for it.

For now, you can change source to prefix.

This also tells me we can improve on the error message to point users like yourself in the right direction 🙂

ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Aug 19, 2025
Adding a development Proxy and dedicated Web configuration File

<!--
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
-->

Flutter's current web development configuration relies on CLI arguments
and does not have a development proxy. This PR adds a development proxy
to flutter and a designated web_dev_config.yaml where web configuration
settings are loaded from.

Issues:
flutter#170834

Document:

[HERE](https://docs.google.com/document/d/1Ud9D3F0GxB5Ocoo5NnAy7PH5oo3qxvALxUlAXMCANJ0/edit?usp=sharing)

## 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.
- [ ] 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: Sydney Bao <[email protected]>
Co-authored by: Salem Iranloye <[email protected]>

---------

Co-authored-by: Kevin Moore <[email protected]>
Co-authored-by: Sydney Bao <[email protected]>
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
Adding a development Proxy and dedicated Web configuration File

<!--
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
-->

Flutter's current web development configuration relies on CLI arguments
and does not have a development proxy. This PR adds a development proxy
to flutter and a designated web_dev_config.yaml where web configuration
settings are loaded from.

Issues:
flutter#170834

Document:

[HERE](https://docs.google.com/document/d/1Ud9D3F0GxB5Ocoo5NnAy7PH5oo3qxvALxUlAXMCANJ0/edit?usp=sharing)

## 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.
- [ ] 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: Sydney Bao <[email protected]>
Co-authored by: Salem Iranloye <[email protected]>

---------

Co-authored-by: Kevin Moore <[email protected]>
Co-authored-by: Sydney Bao <[email protected]>
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
Adding a development Proxy and dedicated Web configuration File

<!--
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
-->

Flutter's current web development configuration relies on CLI arguments
and does not have a development proxy. This PR adds a development proxy
to flutter and a designated web_dev_config.yaml where web configuration
settings are loaded from.

Issues:
flutter#170834

Document:

[HERE](https://docs.google.com/document/d/1Ud9D3F0GxB5Ocoo5NnAy7PH5oo3qxvALxUlAXMCANJ0/edit?usp=sharing)

## 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.
- [ ] 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: Sydney Bao <[email protected]>
Co-authored by: Salem Iranloye <[email protected]>

---------

Co-authored-by: Kevin Moore <[email protected]>
Co-authored-by: Sydney Bao <[email protected]>
@woprandi
Copy link
Contributor

woprandi commented Nov 6, 2025

Can we report issue about this feature ?

@kevmoo
Copy link
Contributor

kevmoo commented Nov 6, 2025

@woprandi – please! In a new issue, though.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
Adding a development Proxy and dedicated Web configuration File

<!--
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
-->

Flutter's current web development configuration relies on CLI arguments
and does not have a development proxy. This PR adds a development proxy
to flutter and a designated web_dev_config.yaml where web configuration
settings are loaded from.

Issues:
flutter#170834

Document:

[HERE](https://docs.google.com/document/d/1Ud9D3F0GxB5Ocoo5NnAy7PH5oo3qxvALxUlAXMCANJ0/edit?usp=sharing)

## 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.
- [ ] 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: Sydney Bao <[email protected]>
Co-authored by: Salem Iranloye <[email protected]>

---------

Co-authored-by: Kevin Moore <[email protected]>
Co-authored-by: Sydney Bao <[email protected]>
@GreatTux
Copy link

Issue raised against this change here: #179014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants