chore: update to firebase_functions 0.6.0#1282
chore: update to firebase_functions 0.6.0#1282brianquinlan wants to merge 1 commit intofirebase:dart-launchfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the firebase_functions dependency to version 0.6.0 and replaces the fireUp initialization with runFunctions across several Dart quickstart projects. The review feedback identifies that the upgrade to 0.6.0 introduces breaking changes to the onCall handler signature and the removal of CallableResult that have not been addressed in the code. Furthermore, it is recommended to use await runFunctions in the main entry points to ensure proper lifecycle management of the server.
| void main() { | ||
| runFunctions((firebase) { |
There was a problem hiding this comment.
The update to firebase_functions 0.6.0 introduces breaking changes that are not fully addressed in the function handlers:
onCallSignature: The handler now takes a singleCallableRequestargument. Theresponseobject is now a property of therequestobject. You must update line 52 to(request) async {and line 76 toawait request.response.sendChunk(result);.CallableResultRemoval: This class has been removed in 0.6.0. You should return the result directly (e.g.,return await Future.wait(allRequests);on line 86).- Async Main: It is recommended to
await runFunctionsto ensure the entry point correctly handles the server's lifecycle.
| void main() { | |
| runFunctions((firebase) { | |
| void main() async { | |
| await runFunctions((firebase) { |
| void main() { | ||
| runFunctions((firebase) { |
There was a problem hiding this comment.
The update to firebase_functions 0.6.0 requires updates to the onCall handler signature and return type:
onCallSignature: The handler on line 25 should be updated to take only one argument:(request) async {. Theresponseargument is no longer passed separately.CallableResultRemoval: TheCallableResultwrapper on line 60 should be removed, and the map should be returned directly. Remember to also remove the closing parenthesis on line 65.- Async Main: Consider using
await runFunctionsfor better lifecycle management.
| void main() { | |
| runFunctions((firebase) { | |
| void main() async { | |
| await runFunctions((firebase) { |
| void main() { | ||
| runFunctions((firebase) { |
There was a problem hiding this comment.
| void main() { | ||
| runFunctions((firebase) { |
No description provided.