Skip to content
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

[http] Migrate to the latest pkg:web, require Dart 3.3 #1132

Merged
merged 2 commits into from
Feb 15, 2024
Merged

Conversation

kevmoo
Copy link
Member

@kevmoo kevmoo commented Feb 15, 2024

No description provided.

@kevmoo kevmoo requested a review from devoncarew February 15, 2024 17:01
@github-actions github-actions bot added package:http type-infra A repository infrastructure change or enhancement labels Feb 15, 2024
@kevmoo kevmoo requested a review from natebosch February 15, 2024 17:34
@natebosch natebosch changed the title [http] Migrate to the latest pkg:http, require Dart 3.3 [http] Migrate to the latest pkg:web, require Dart 3.3 Feb 15, 2024
@kevmoo kevmoo merged commit d8b237d into master Feb 15, 2024
22 checks passed
@kevmoo kevmoo deleted the latest_pkg_web branch February 15, 2024 17:46
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Feb 15, 2024
Revisions updated by `dart tools/rev_sdk_deps.dart`.

http (https://github.com/dart-lang/http/compare/f0a02f9..d8b237d):
  d8b237d  2024-02-15  Kevin Moore  [http] Migrate to the latest pkg:web, require Dart 3.3 (dart-lang/http#1132)
  5179d1c  2024-02-01  dependabot[bot]  Bump actions/cache from 3.3.2 to 4.0.0 (dart-lang/http#1125)
  0b803e8  2024-02-01  dependabot[bot]  Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (dart-lang/http#1124)
  82e0424  2024-01-29  Brian Quinlan  Use preferred flutter version constraints (dart-lang/http#1119)
  ccefa7c  2024-01-17  Brian Quinlan  Support `BaseResponseWithUrl` in `package:cupertino_http` and `package:cronet_http` (dart-lang/http#1110)
  e7a8e25  2024-01-16  Brian Quinlan  Add `BaseResponseWithUrl.url` (dart-lang/http#1109)
  c8f17a6  2024-01-12  Brian Quinlan  Add a contributing guide (dart-lang/http#1115)
  ebd86b9  2024-01-12  Brian Quinlan  Add the ability to get response headers as a `Map<String, List<String>>` (dart-lang/http#1114)
  5c75da6  2024-01-12  Brian Quinlan  Add tests for sending "cookie" and receiving "set-cookie" headers (dart-lang/http#1113)
  c2a6d64  2024-01-12  Alex Li  [cronet_http] ⬇️ Downgrade `minSdkVersion` to 21 (dart-lang/http#1104)
  661f5d6  2024-01-08  Brian Quinlan  Use `package:http_image_provider` in all `Client` implementation examples (dart-lang/http#1089)
  473a892  2024-01-04  Brian Quinlan  Remove the "play-services-cronet" dependency in the example app when building `package:cronet_http_embedded` (dart-lang/http#1103)
  e79ebe1  2024-01-03  Moritz  Fix `labeler.yml` (dart-lang/http#1099)
  73b0b1c  2024-01-01  dependabot[bot]  Bump actions/labeler from 4.3.0 to 5.0.0 (dart-lang/http#1096)
  15ec3ba  2023-12-21  Brian Quinlan  Prepare to publish `package:cronet_http` as 1.0.0 (dart-lang/http#1087)
  26e55c3  2023-12-21  Brian Quinlan  cronet_http: require android API level 28 (dart-lang/http#1088)
  b10f448  2023-12-22  Alex Li  [cronet_http] Enables CI for `cronet_http_embedded` (dart-lang/http#1070)
  a5b8eec  2023-12-18  Brian Quinlan  Prepare to publish cupertino 1.2.0 (dart-lang/http#1080)
  c114aa0  2023-12-15  Brian Quinlan  Add a fake response for PNG images (dart-lang/http#1081)
  db2cb76  2023-12-14  Kevin Moore  Run web tests with wasm with dev Dart sdk (dart-lang/http#1078)
  36f98e9  2023-12-12  Brian Quinlan  Fix a bug where BrowserClient was listed as requiring Flutter (dart-lang/http#1077)
  db7f165  2023-12-07  Brian Quinlan  Provide an example of configuring IOClient with an HttpClient. (dart-lang/http#1074)
  cd748b6  2023-12-04  Brian Quinlan  Document that runWithClient must be called for every isolate (dart-lang/http#1069)
  f585947  2023-12-04  Brian Quinlan  Test persistentConnection with large request bodies (dart-lang/http#984)
  7c05dde  2023-12-04  Brian Quinlan  Add documentation for "no_default_http_client" (dart-lang/http#1068)
  d8983fa  2023-12-04  Brian Quinlan  Add support for setting headers for all requests (dart-lang/http#1060)
  c90496e  2023-12-04  Brian Quinlan  Document how to use replacement `Client` implementations (dart-lang/http#1063)
  c8536e4  2023-12-01  Kevin Moore  [http_client_conformance_tests] Updates to support wasm compilation (dart-lang/http#1064)
  5dd5140  2023-12-01  dependabot[bot]  Bump actions/setup-java from 3 to 4 (dart-lang/http#1065)
  064f510  2023-11-30  Devon Carew  misc cleanup of yaml files (dart-lang/http#1061)
  22f52e2  2023-11-30  Brian Quinlan  Update pubspec.yaml to 0.4.2 (dart-lang/http#1059)
  40a46d8  2023-11-29  Brian Quinlan  Fix a bug where cronet_http sends incorrect HTTP request methods (dart-lang/http#1058)
  c125ed5  2023-11-27  Kevin Moore  [http] Allow pkg:web v0.3.0 (dart-lang/http#1055)
  9fb4cfa  2023-11-22  Kevin Moore  Update lints to latest, etc (dart-lang/http#1048)
  5e84d9f  2023-11-21  Kevin Moore  Update platform-specific imports for wasm (dart-lang/http#1051)
  8c9feb5  2023-11-21  Kevin Moore  [http] Fix type cast for dart2wasm (dart-lang/http#1050)
  a2f0b25  2023-11-21  Kevin Moore  [http] use pkg:web, require Dart 3.2 (dart-lang/http#1049)

markdown (https://github.com/dart-lang/markdown/compare/c2b8429..6efe141):
  6efe141  2024-02-14  Kevin Moore  Migrate example to pkg:web, update minimum required Dart version (dart-lang/markdown#582)

web_socket_channel (https://github.com/dart-lang/web_socket_channel/compare/5241175..3db86bc):
  3db86bc  2024-02-15  Kevin Moore  Require Dart 3.3 and the latest pkg:web (dart-lang/web_socket_channel#326)
  1c4a923  2024-02-01  dependabot[bot]  Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (dart-lang/web_socket_channel#323)
  041aa3c  2024-01-08  Devon Carew  adjust the HtmlWebSocketChannel ctor parameter type; rev to 2.4.3 (dart-lang/web_socket_channel#320)
  0e8bedc  2024-01-04  Tyler Dunn  Allow pkg:web v0.3.0 (dart-lang/web_socket_channel#306)
  62370cc  2024-01-01  dependabot[bot]  Bump actions/stale from 8.0.0 to 9.0.0 (dart-lang/web_socket_channel#312)
  2a0563f  2023-12-18  Kevin Moore  Prepare release v2.4.1 (dart-lang/web_socket_channel#301)
  906c944  2023-12-14  Kevin Moore  CI: test dev SDK with dart2wasm (dart-lang/web_socket_channel#304)
  a316c53  2023-12-13  Kevin Moore  Rename helper extensions to not collide with pkg:web unreleased (dart-lang/web_socket_channel#303)
  547184a  2023-12-11  Kevin Moore  blast_repo fixes (dart-lang/web_socket_channel#302)
  969bc6c  2023-12-09  Ömer Sinan Ağacan  Fix JS value to Dart conversion when receiving from a web socket (dart-lang/web_socket_channel#298)
  df096a9  2023-11-30  Ömer Sinan Ağacan  Remove removed lints (dart-lang/web_socket_channel#299)
  67bf9a3  2023-11-23  Nate Bosch  Drop some use of ! (dart-lang/web_socket_channel#296)
  d4a8d70  2023-11-22  Kevin Moore  Small tweak (dart-lang/web_socket_channel#295)
  9e80b8d  2023-11-22  Kevin Moore  migrate to pkg web (dart-lang/web_socket_channel#294)

Change-Id: I87c4baa07efc5fc2bb283c7b32e69ad69c5a02aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352960
Reviewed-by: Kevin Moore <[email protected]>
Commit-Queue: Devon Carew <[email protected]>
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Feb 16, 2024
This reverts commit 8d703d1.

Reason for revert: HHH bot is broken

Original change's description:
> [deps] rev http, markdown, web_socket_channel
>
> Revisions updated by `dart tools/rev_sdk_deps.dart`.
>
> http (https://github.com/dart-lang/http/compare/f0a02f9..d8b237d):
>   d8b237d  2024-02-15  Kevin Moore  [http] Migrate to the latest pkg:web, require Dart 3.3 (dart-lang/http#1132)
>   5179d1c  2024-02-01  dependabot[bot]  Bump actions/cache from 3.3.2 to 4.0.0 (dart-lang/http#1125)
>   0b803e8  2024-02-01  dependabot[bot]  Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (dart-lang/http#1124)
>   82e0424  2024-01-29  Brian Quinlan  Use preferred flutter version constraints (dart-lang/http#1119)
>   ccefa7c  2024-01-17  Brian Quinlan  Support `BaseResponseWithUrl` in `package:cupertino_http` and `package:cronet_http` (dart-lang/http#1110)
>   e7a8e25  2024-01-16  Brian Quinlan  Add `BaseResponseWithUrl.url` (dart-lang/http#1109)
>   c8f17a6  2024-01-12  Brian Quinlan  Add a contributing guide (dart-lang/http#1115)
>   ebd86b9  2024-01-12  Brian Quinlan  Add the ability to get response headers as a `Map<String, List<String>>` (dart-lang/http#1114)
>   5c75da6  2024-01-12  Brian Quinlan  Add tests for sending "cookie" and receiving "set-cookie" headers (dart-lang/http#1113)
>   c2a6d64  2024-01-12  Alex Li  [cronet_http] ⬇️ Downgrade `minSdkVersion` to 21 (dart-lang/http#1104)
>   661f5d6  2024-01-08  Brian Quinlan  Use `package:http_image_provider` in all `Client` implementation examples (dart-lang/http#1089)
>   473a892  2024-01-04  Brian Quinlan  Remove the "play-services-cronet" dependency in the example app when building `package:cronet_http_embedded` (dart-lang/http#1103)
>   e79ebe1  2024-01-03  Moritz  Fix `labeler.yml` (dart-lang/http#1099)
>   73b0b1c  2024-01-01  dependabot[bot]  Bump actions/labeler from 4.3.0 to 5.0.0 (dart-lang/http#1096)
>   15ec3ba  2023-12-21  Brian Quinlan  Prepare to publish `package:cronet_http` as 1.0.0 (dart-lang/http#1087)
>   26e55c3  2023-12-21  Brian Quinlan  cronet_http: require android API level 28 (dart-lang/http#1088)
>   b10f448  2023-12-22  Alex Li  [cronet_http] Enables CI for `cronet_http_embedded` (dart-lang/http#1070)
>   a5b8eec  2023-12-18  Brian Quinlan  Prepare to publish cupertino 1.2.0 (dart-lang/http#1080)
>   c114aa0  2023-12-15  Brian Quinlan  Add a fake response for PNG images (dart-lang/http#1081)
>   db2cb76  2023-12-14  Kevin Moore  Run web tests with wasm with dev Dart sdk (dart-lang/http#1078)
>   36f98e9  2023-12-12  Brian Quinlan  Fix a bug where BrowserClient was listed as requiring Flutter (dart-lang/http#1077)
>   db7f165  2023-12-07  Brian Quinlan  Provide an example of configuring IOClient with an HttpClient. (dart-lang/http#1074)
>   cd748b6  2023-12-04  Brian Quinlan  Document that runWithClient must be called for every isolate (dart-lang/http#1069)
>   f585947  2023-12-04  Brian Quinlan  Test persistentConnection with large request bodies (dart-lang/http#984)
>   7c05dde  2023-12-04  Brian Quinlan  Add documentation for "no_default_http_client" (dart-lang/http#1068)
>   d8983fa  2023-12-04  Brian Quinlan  Add support for setting headers for all requests (dart-lang/http#1060)
>   c90496e  2023-12-04  Brian Quinlan  Document how to use replacement `Client` implementations (dart-lang/http#1063)
>   c8536e4  2023-12-01  Kevin Moore  [http_client_conformance_tests] Updates to support wasm compilation (dart-lang/http#1064)
>   5dd5140  2023-12-01  dependabot[bot]  Bump actions/setup-java from 3 to 4 (dart-lang/http#1065)
>   064f510  2023-11-30  Devon Carew  misc cleanup of yaml files (dart-lang/http#1061)
>   22f52e2  2023-11-30  Brian Quinlan  Update pubspec.yaml to 0.4.2 (dart-lang/http#1059)
>   40a46d8  2023-11-29  Brian Quinlan  Fix a bug where cronet_http sends incorrect HTTP request methods (dart-lang/http#1058)
>   c125ed5  2023-11-27  Kevin Moore  [http] Allow pkg:web v0.3.0 (dart-lang/http#1055)
>   9fb4cfa  2023-11-22  Kevin Moore  Update lints to latest, etc (dart-lang/http#1048)
>   5e84d9f  2023-11-21  Kevin Moore  Update platform-specific imports for wasm (dart-lang/http#1051)
>   8c9feb5  2023-11-21  Kevin Moore  [http] Fix type cast for dart2wasm (dart-lang/http#1050)
>   a2f0b25  2023-11-21  Kevin Moore  [http] use pkg:web, require Dart 3.2 (dart-lang/http#1049)
>
> markdown (https://github.com/dart-lang/markdown/compare/c2b8429..6efe141):
>   6efe141  2024-02-14  Kevin Moore  Migrate example to pkg:web, update minimum required Dart version (dart-lang/markdown#582)
>
> web_socket_channel (https://github.com/dart-lang/web_socket_channel/compare/5241175..3db86bc):
>   3db86bc  2024-02-15  Kevin Moore  Require Dart 3.3 and the latest pkg:web (dart-lang/web_socket_channel#326)
>   1c4a923  2024-02-01  dependabot[bot]  Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (dart-lang/web_socket_channel#323)
>   041aa3c  2024-01-08  Devon Carew  adjust the HtmlWebSocketChannel ctor parameter type; rev to 2.4.3 (dart-lang/web_socket_channel#320)
>   0e8bedc  2024-01-04  Tyler Dunn  Allow pkg:web v0.3.0 (dart-lang/web_socket_channel#306)
>   62370cc  2024-01-01  dependabot[bot]  Bump actions/stale from 8.0.0 to 9.0.0 (dart-lang/web_socket_channel#312)
>   2a0563f  2023-12-18  Kevin Moore  Prepare release v2.4.1 (dart-lang/web_socket_channel#301)
>   906c944  2023-12-14  Kevin Moore  CI: test dev SDK with dart2wasm (dart-lang/web_socket_channel#304)
>   a316c53  2023-12-13  Kevin Moore  Rename helper extensions to not collide with pkg:web unreleased (dart-lang/web_socket_channel#303)
>   547184a  2023-12-11  Kevin Moore  blast_repo fixes (dart-lang/web_socket_channel#302)
>   969bc6c  2023-12-09  Ömer Sinan Ağacan  Fix JS value to Dart conversion when receiving from a web socket (dart-lang/web_socket_channel#298)
>   df096a9  2023-11-30  Ömer Sinan Ağacan  Remove removed lints (dart-lang/web_socket_channel#299)
>   67bf9a3  2023-11-23  Nate Bosch  Drop some use of ! (dart-lang/web_socket_channel#296)
>   d4a8d70  2023-11-22  Kevin Moore  Small tweak (dart-lang/web_socket_channel#295)
>   9e80b8d  2023-11-22  Kevin Moore  migrate to pkg web (dart-lang/web_socket_channel#294)
>
> Change-Id: I87c4baa07efc5fc2bb283c7b32e69ad69c5a02aa
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352960
> Reviewed-by: Kevin Moore <[email protected]>
> Commit-Queue: Devon Carew <[email protected]>

Change-Id: I8723a343908227e39604cba7827c0f99912a10f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352967
Reviewed-by: Siva Annamalai <[email protected]>
Bot-Commit: Rubber Stamper <[email protected]>
Commit-Queue: Siva Annamalai <[email protected]>
Auto-Submit: Devon Carew <[email protected]>
Reviewed-by: Devon Carew <[email protected]>
@vanlooverenkoen
Copy link

@kevmoo is it normal that this is a minor version bump?

@kevmoo
Copy link
Member Author

kevmoo commented Mar 15, 2024

@vanlooverenkoen "normal"? I think so.

@vanlooverenkoen
Copy link

@kevmoo I would think that if we require something it would result in a breaking change.

MAJOR version when you make incompatible API changes
MINOR version when you add functionality in a backward compatible manner
PATCH version when you make backward compatible bug fixes

1.2.1 is not backwards compatible with 1.2.0 so feel like this is not "normal" when following semantic versioning.

What if for example 1.2.0 has a major security issue? We can not create a patch for 1.2.0 on 1.2.1? because it already exist. And we also can not use 1.2.2 because 1.2.1 already requires a higher dart sdk?

Or am I missing something.

@kevmoo
Copy link
Member Author

kevmoo commented Mar 15, 2024

What is not backward compatible in 1.2.1 compared to 1.2.0?

@vanlooverenkoen
Copy link

This is my project:

I am currently on Flutter 3.16.9 & dart 3.2.6

This works fine:

environment:
  sdk: ">=2.18.4 <3.0.0"
  flutter: ^3.7.0

dependencies:
  flutter:
    sdk: flutter
  http: ^1.2.0
  intl: ^0.18.1

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.0

This fails:

environment:
  sdk: ">=2.18.4 <3.0.0"
  flutter: ^3.7.0

dependencies:
  flutter:
    sdk: flutter
  http: ^1.2.1 # updated to 1.2.1 from 1.2.0
  intl: ^0.18.1

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.0

with this error:

Resolving dependencies...
The current Dart SDK version is 3.2.6.

Because my_app depends on http >=1.2.1 which requires SDK version ^3.3.0, version solving failed.


You can try the following suggestion to make the pubspec resolve:
* Consider downgrading your constraint on http: flutter pub add http:^1.2.0

So 1.2.1 is not compatible with 1.2.0 which should be based on semantic versioning.

@kevmoo
Copy link
Member Author

kevmoo commented Mar 15, 2024

Being unable to get the latest version does not mean it's incompatible. Everything works fine if you just get 1.2.0.

@vanlooverenkoen
Copy link

Yes I know that 1.2.0 works, but that is not my point. What happens if http 1.2.0 has a major security issue? It is not possible to patch 1.2.0 because 1.2.1 is already created and requires a newer dart version. Which is incompatible with dart 3.2.x.

@kevmoo
Copy link
Member Author

kevmoo commented Mar 15, 2024

@vanlooverenkoen – we will publish 1.2.0+1 🤷

@vanlooverenkoen
Copy link

Is that the semantic versioning standard? I would think that bugs on 1.2.0 should be fixed in 1.2.1?

@kevmoo
Copy link
Member Author

kevmoo commented Mar 15, 2024

@vanlooverenkoen functionally I don't know if it'd affect folks.

@vanlooverenkoen
Copy link

We have had countless issues with maintainers updating a breaking change in a minor version. Or requiring a breaking change dependency in a package we were using. Resulting in bug or our project not being able to compile. It would be nice if we could have a community standard on which we can rely for versioning.

I feel like we (as a community) are using semantic versioning as we please and not following the actual standard.

@natebosch
Copy link
Member

natebosch commented Mar 15, 2024

We have had countless issues with maintainers updating a breaking change in a minor version.
...
Resulting in bug or our project not being able to compile.

A breaking change in a minor version describes a situation where you make no change to pubspec.yaml but a dart pub upgrade makes an app fail to compile. That is not the situation described above. An inability to pub solve to a new package patch version is not a breaking change.

Or requiring a breaking change dependency in a package we were using.

A change to dependency compatibilities is not a breaking change. Being unable to pub solve to new package versions which depend on an SDK you don't have is working as intended. I have not read a spec for semantic versioning which requires major version changes for any incompatible dependency change.

I don't think the flutter SDK pins package:http, so I don't think any flutter SDK update should break working compiles or pub solves as it relates to this package.

Manually updating a dependency to the latest published patch version and expecting it to continue to pub solve correctly is not a supported workflow.

I feel like we (as a community) are using semantic versioning as we please and not following the actual standard.

I can't speak for the entire community, but in my opinion the Dart team owned packages and the Dart SDK have mostly followed semver principles and the deviations we've had have been pragmatic and low impact.

Flutter SDK doesn't use semantic versioning, but I think most flutter plugins published to pub strive to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:http type-infra A repository infrastructure change or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants