-
Notifications
You must be signed in to change notification settings - Fork 4k
[cloud_functions] Prepare for web implementation #1826
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
Conversation
…_functions plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fantastic! Thank you so much for the contribution. Can you please update to use the new plugin_platform_interface class?
...oud_functions/cloud_functions_platform_interface/lib/cloud_functions_platform_interface.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tackling this!
In addition to what Collin said, I'd also recommend that you started by moving the current contents of the cloud_functions
plugin to cloud_functions/cloud_functions
; that should be a very quick PR, and it'll allow you to work on the rest of the packages without "inheriting" code or config from the old plugin.
...oud_functions/cloud_functions_platform_interface/lib/cloud_functions_platform_interface.dart
Outdated
Show resolved
Hide resolved
...oud_functions/cloud_functions_platform_interface/lib/cloud_functions_platform_interface.dart
Outdated
Show resolved
Hide resolved
…isolate it from following changes.
… interface to be a close reflection of the MethodChannel interface.
...oud_functions/cloud_functions_platform_interface/lib/cloud_functions_platform_interface.dart
Outdated
Show resolved
Hide resolved
...oud_functions/cloud_functions_platform_interface/lib/cloud_functions_platform_interface.dart
Outdated
Show resolved
Hide resolved
'app': appName, | ||
'region': region, | ||
'origin': origin, | ||
'timeoutMicroseconds': timeout?.inMicroseconds, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be 'timeoutMilliseconds': timeout?.inMilliseconds,
based on https://github.com/FirebaseExtended/flutterfire/blob/master/packages/cloud_functions/android/src/main/java/io/flutter/plugins/firebase/cloudfunctions/CloudFunctionsPlugin.java#L52
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that mean that the existing implementation is a bug?
https://github.com/FirebaseExtended/flutterfire/blob/master/packages/cloud_functions/lib/src/https_callable.dart#L38
I mean, I'm happy to make the change if it's the right thing to do, but I don't want to break something that works, currently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the Android code is the odd one out. iOS is also using microseconds:
NSNumber *timeoutMicroseconds = call.arguments[@"timeoutMicroseconds"];
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it looks like a bug in the Android implementation
...oud_functions/cloud_functions_platform_interface/lib/src/method_channel_cloud_functions.dart
Outdated
Show resolved
Hide resolved
...oud_functions/cloud_functions_platform_interface/lib/src/method_channel_cloud_functions.dart
Show resolved
Hide resolved
packages/cloud_functions/cloud_functions_platform_interface/LICENSE
Outdated
Show resolved
Hide resolved
...oud_functions/cloud_functions_platform_interface/lib/cloud_functions_platform_interface.dart
Outdated
Show resolved
Hide resolved
...oud_functions/cloud_functions_platform_interface/lib/src/method_channel_cloud_functions.dart
Outdated
Show resolved
Hide resolved
...oud_functions/cloud_functions_platform_interface/lib/src/method_channel_cloud_functions.dart
Outdated
Show resolved
Hide resolved
…pyright date in LICENSE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks, @sbeitzel ! Just merged this and uploaded |
Description
Based on the layout of the firebase_auth plugin, this change sets the stage for a web implementation of the cloud_functions plugin. It adds a new package, cloud_functions_platform_interface.
Related Issues
This PR addresses issue flutter/flutter#45299
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?