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

Replace Objective-C implemented delegates with Dart implementations #1218

Merged
merged 60 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
dcd2997
Protocol work
brianquinlan May 30, 2024
e993fc0
More fixes
brianquinlan May 30, 2024
951385a
More fixes
brianquinlan May 30, 2024
2ccf126
Compiles (except for bindings)
brianquinlan Jun 4, 2024
334386e
Fix error string
brianquinlan Jun 4, 2024
89a7617
More
brianquinlan Jun 5, 2024
13dab90
All tests passing
brianquinlan Jun 6, 2024
bf94f4e
Delegate
brianquinlan Jun 6, 2024
9527dd4
Regen
brianquinlan Jun 25, 2024
419de5a
Compiling
brianquinlan Jul 9, 2024
1f97822
Fixes
brianquinlan Jul 11, 2024
cd6ff95
Merge remote-tracking branch 'upstream/master' into dart_protocol
brianquinlan Sep 3, 2024
a325f08
Merge
brianquinlan Sep 3, 2024
aa0ebc6
Protocol
brianquinlan Sep 11, 2024
0c485c2
Working conformance
brianquinlan Sep 23, 2024
715d3fe
Works on iOS
brianquinlan Oct 1, 2024
8569676
Track task count
brianquinlan Oct 2, 2024
7f6608d
Fix
brianquinlan Oct 2, 2024
868b929
WebSockets work!
brianquinlan Oct 2, 2024
5d0beb3
Remove useless utils
brianquinlan Oct 2, 2024
acbb822
Remove source
brianquinlan Oct 2, 2024
0b14c14
Update .gitattributes
brianquinlan Oct 2, 2024
2137584
Remove DS_Store
brianquinlan Oct 2, 2024
e256587
Remove
brianquinlan Oct 2, 2024
6e1c66f
Update http_url_response_test.dart
brianquinlan Oct 2, 2024
6541724
Tests compile but don't pass
brianquinlan Oct 4, 2024
3b4c6a4
Fix
brianquinlan Oct 4, 2024
f7776d9
Fix data test
brianquinlan Oct 7, 2024
58874eb
Update url_session_delegate_test.dart
brianquinlan Oct 7, 2024
db3a9fc
Tests are fixed
brianquinlan Oct 9, 2024
95880e4
Support file download
brianquinlan Oct 10, 2024
4a8b5a9
Stream to NSStream
brianquinlan Oct 10, 2024
6698a62
Looking at stuff fixes
brianquinlan Oct 10, 2024
9254317
Fixes
brianquinlan Oct 10, 2024
438a170
Fix pubspec versions
brianquinlan Oct 10, 2024
ec34375
Reduce generated code size
brianquinlan Oct 10, 2024
9d96626
Fix dependency
brianquinlan Oct 21, 2024
a9c494e
Update pubspec.yaml
brianquinlan Oct 21, 2024
8f7000c
Update pubspec.yaml
brianquinlan Oct 21, 2024
2d1e7d6
Merge remote-tracking branch 'upstream/master' into dart_protocol
brianquinlan Oct 21, 2024
9da1312
Update pubspec.yaml
brianquinlan Oct 21, 2024
aa4eca7
Monorepo
brianquinlan Oct 21, 2024
cace60f
Test
brianquinlan Oct 21, 2024
4731092
Update pubspec.yaml
brianquinlan Oct 21, 2024
e9ed9c6
test
brianquinlan Oct 21, 2024
98be9b1
Test
brianquinlan Oct 21, 2024
0ccae2f
Update dart.yml
brianquinlan Oct 21, 2024
bdfd356
More CI fixes
brianquinlan Oct 21, 2024
2dde428
Bump http version
brianquinlan Oct 21, 2024
f081949
Fix
brianquinlan Oct 22, 2024
5d378c1
Test, revert!
brianquinlan Oct 22, 2024
770498a
Protocol fix.
brianquinlan Oct 22, 2024
2d32e68
Ignore some files
brianquinlan Oct 22, 2024
26d7753
Update health.yaml
brianquinlan Oct 22, 2024
0bbc612
Fix
brianquinlan Oct 22, 2024
2465c2d
Update cronet.yml
brianquinlan Oct 22, 2024
57db225
Update utils.h
brianquinlan Oct 22, 2024
3394fb0
No fail-fast
brianquinlan Oct 22, 2024
99d8d3c
Version
brianquinlan Oct 22, 2024
e14f6e2
Update pubspec.yaml
brianquinlan Oct 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/cronet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ jobs:
verify:
name: Format & Analyze & Test
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
cronetHttpNoPlay: ['false', 'true']
defaults:
run:
working-directory: pkgs/cronet_http
steps:
- name: Delete unnecessary tools 🔧
uses: jlumbroso/[email protected]
with:
android: false # Don't remove Android tools
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
with:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/cupertino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ jobs:
run:
working-directory: pkgs/cupertino_http
strategy:
fail-fast: false
matrix:
# Test on the minimum supported flutter version and the latest
# version.
flutter-version: ["3.22.0", "any"]
flutter-version: ["3.24.0", "any"]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
Expand All @@ -50,9 +51,9 @@ jobs:
- uses: futureware-tech/simulator-action@bfa03d93ec9de6dacb0c5553bbf8da8afc6c2ee9
with:
os: iOS
os_version: '>=12.0'
os_version: '>=13.0'
- name: Run tests
run: |
cd example
flutter pub get
flutter test integration_test/main.dart
flutter test integration_test/main.dart --test-randomize-ordering-seed=random
252 changes: 75 additions & 177 deletions .github/workflows/dart.yml

Large diffs are not rendered by default.

115 changes: 113 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,119 @@
# Adapted from https://github.com/flutter/flutter/blob/master/.gitignore

# Miscellaneous
*.class
*.lock
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# Visual Studio Code related
.vscode/
.classpath
.project
.settings/
.vscode/*

# Don’t commit the following directories created by pub.
.dart_tool
# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
**/generated_plugin_registrant.dart
.packages
.pub-preload-cache/
.pub-cache/
.pub/
build/
flutter_*.png
linked_*.ds
unlinked.ds
unlinked_spec.ds
pubspec.lock
pubspec_overrides.yaml

# Android related
**/android/**/gradle-wrapper.jar
.gradle/
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java
**/android/key.properties
*.jks

# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/.last_build_id
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Flutter.podspec
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/ephemeral
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

# macOS
**/Flutter/ephemeral/
**/Pods/
**/macos/Flutter/GeneratedPluginRegistrant.swift
**/macos/Flutter/ephemeral
**/xcuserdata/

# Windows
**/windows/flutter/ephemeral/
**/windows/flutter/generated_plugin_registrant.cc
**/windows/flutter/generated_plugin_registrant.h
**/windows/flutter/generated_plugins.cmake

# Linux
**/linux/flutter/ephemeral/
**/linux/flutter/generated_plugin_registrant.cc
**/linux/flutter/generated_plugin_registrant.h
**/linux/flutter/generated_plugins.cmake

# Coverage
coverage/

# Symbols
app.*.symbols

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
!/dev/ci/**/Gemfile.lock
!.vscode/settings.json
4 changes: 1 addition & 3 deletions pkgs/cupertino_http/.gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# ffigen generated code
lib/src/native_cupertino_bindings.dart linguist-generated

# vendored Dart API code
src/dart-sdk/** linguist-vendored
darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m linguist-generated
21 changes: 20 additions & 1 deletion pkgs/cupertino_http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
## 1.5.2-wip
## 2.0.0-wip

* The behavior of `CupertinoClient` and `CupertinoWebSocket` has not changed.
* **Breaking:** `MutableURLRequest.httpBodyStream` now takes a `NSInputStream`
instead of a `Stream<List<int>>`.
* **Breaking:** The following enums/classes previous defined by
`package:cupertino_http` are now imported from `package:objective_c`:
* `NSData`
* `NSError`
* `NSHTTPCookieAcceptPolicy`
* `NSMutableData`
* `NSURLRequestCachePolicy`
* `NSURLRequestNetworkServiceType`
* `NSURLSessionMultipathServiceType`
* `NSURLSessionResponseDisposition`
* `NSURLSessionTaskState`
* `NSURLSessionWebSocketCloseCode`
* `NSURLSessionWebSocketMessageType`
* **Breaking:** `URLSession.dataTaskWithCompletionHandler` is no longer
supported for background sessions.

## 1.5.1

Expand Down
1 change: 0 additions & 1 deletion pkgs/cupertino_http/darwin/Classes/CUPHTTPClientDelegate.m

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion pkgs/cupertino_http/darwin/Classes/dart_api_dl.c

This file was deleted.

13 changes: 4 additions & 9 deletions pkgs/cupertino_http/darwin/cupertino_http.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@ Pod::Spec.new do |s|
s.homepage = 'https://github.com/dart-lang/http/tree/master/pkgs/cupertino_http'
s.license = { :type => 'BSD', :file => '../LICENSE' }
s.author = { 'TODO' => 'use-valid-author' }
s.source = { :http => 'https://github.com/dart-lang/http/tree/master/pkgs/cupertino_http' }

# This will ensure the source files in Classes/ are included in the native
# builds of apps using this FFI plugin. Podspec does not support relative
# paths, so Classes contains a forwarder C file that relatively imports
# `../src/*` so that the C sources can be shared among all target platforms.
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.source_files = 'cupertino_http/Sources/cupertino_http/**/*'
s.ios.dependency 'Flutter'
s.osx.dependency 'FlutterMacOS'
s.ios.deployment_target = '12.0'
s.osx.deployment_target = '10.14'
s.requires_arc = []
s.ios.deployment_target = '13.0' # Required for NSURLSessionWebSocketDelegate.
s.osx.deployment_target = '10.15' # Required for NSURLSessionWebSocketDelegate.

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.swift_version = '5.0'
Expand Down
Loading
Loading