Skip to content

refactor(firebase_functions)!: remove deprecated APIs #4592

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

Merged
merged 1 commit into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ import 'package:flutter/foundation.dart';
import 'package:meta/meta.dart';

export 'package:cloud_functions_platform_interface/cloud_functions_platform_interface.dart'
show
// ignore: deprecated_member_use
CloudFunctionsException,
HttpsCallableOptions,
FirebaseFunctionsException;
show HttpsCallableOptions, FirebaseFunctionsException;

part 'src/firebase_functions.dart';
part 'src/https_callable.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ class FirebaseFunctions extends FirebasePluginPlatform {
return newInstance;
}

// ignore: public_member_api_docs
@Deprecated(
"Constructing CloudFunctions is deprecated, use 'FirebaseFunctions.instance' or 'FirebaseFunctions.instanceFor' instead")
factory FirebaseFunctions({FirebaseApp app, String region}) {
return FirebaseFunctions.instanceFor(app: app, region: region);
}

final String _region;

String _origin;
Expand All @@ -73,12 +66,6 @@ class FirebaseFunctions extends FirebasePluginPlatform {
return HttpsCallable._(_delegate.httpsCallable(_origin, name, options));
}

@Deprecated("Deprecated in favor of httpsCallable()")
// ignore: public_member_api_docs
HttpsCallable getHttpsCallable({@required String functionName}) {
return httpsCallable(functionName);
}

/// Changes this instance to point to a Cloud Functions emulator running locally.
///
/// Set the [origin] of the local emulator, such as "http://localhost:5001", or `null`
Expand All @@ -100,21 +87,3 @@ class FirebaseFunctions extends FirebasePluginPlatform {
_origin = origin;
}
}

@Deprecated("Deprecated in favor of FirebaseFunctions")
// ignore: public_member_api_docs
class CloudFunctions extends FirebaseFunctions {
/// Returns an instance using the default [FirebaseApp].
static FirebaseFunctions get instance {
return FirebaseFunctions.instanceFor(
app: Firebase.app(),
);
}

// ignore: public_member_api_docs
@Deprecated(
"Constructing CloudFunctions is deprecated, use 'FirebaseFunctions.instance' or 'FirebaseFunctions.instanceFor' instead")
factory CloudFunctions({FirebaseApp app, String region}) {
return FirebaseFunctions.instanceFor(app: app, region: region);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ class HttpsCallable {
assert(_delegate != null);
return HttpsCallableResult<T>._(await _delegate.call(parameters));
}

@Deprecated(
"Setting the timeout is deprecated in favor of using [HttpsCallableOptions]")
// ignore: public_member_api_docs
set timeout(Duration duration) {
_delegate.timeout = duration;
}
}

/// Asserts whether a given call parameter is a valid type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,4 @@ void main() {
functions.httpsCallable('testName');
verify(kMockFirebaseFunctionsPlatform.httpsCallable(any, 'testName', any));
});

//
test('getHttpsCallable()', () {
// ignore: deprecated_member_use_from_same_package
functions.getHttpsCallable(functionName: 'testName');
verify(kMockFirebaseFunctionsPlatform.httpsCallable(any, 'testName', any));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,5 @@ void main() {
verify(kMockHttpsCallablePlatform(parameters));
});
});

group('set.timeout (deprecated)', () {
test('sets timeout value', () async {
// ignore: deprecated_member_use_from_same_package
kHttpsCallable.timeout = Duration(minutes: 2);

verify(kMockHttpsCallablePlatform.timeout = Duration(minutes: 2));
});
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ class FirebaseFunctionsException extends FirebaseException
/// Additional data provided with the exception.
final dynamic details;
}

@Deprecated("Deprecated in favor of FirebaseFunctionsException")
// ignore: public_member_api_docs
class CloudFunctionsException extends FirebaseFunctionsException {}