firebase-functions-interop icon indicating copy to clipboard operation
firebase-functions-interop copied to clipboard

Null safety support

Open doppio opened this issue 4 years ago • 8 comments
trafficstars

I'm not sure if this library is still being maintained, but would you consider supporting null safety?

doppio avatar Mar 29 '21 22:03 doppio

Thumbs up 👍

JohannesMilke avatar Apr 27 '21 13:04 JohannesMilke

It doesn't really look like these packages are maintained anymore. However, I went ahead and drafted a PR to support NNBD. I wouldn't mind if you all tested this out for me.

Just add it to your pubspec.yaml as a git dependency:

  firebase_functions_interop: 
    git: [email protected]:SupposedlySam/firebase-functions-interop.git

alternatively you can access it via https rather than ssh

  firebase_functions_interop: 
    git: https://github.com/SupposedlySam/firebase-functions-interop.git

Thanks in advance!

SupposedlySam avatar May 12 '21 20:05 SupposedlySam

@SupposedlySam Do you know why this error occurs while changing to your firebase_functions_interop?

image

JohannesMilke avatar May 19 '21 08:05 JohannesMilke

@JohannesMilke The underlying build_node_compilers package does not support compiling Dart code to Node-compatible JavaScript modules for dependencies in null safety yet. Our team faced the same problem but we are looking forward to a general better solution to run serverless Dart code on GCP.

I recommend trying out Functions Framework since all of the packages related to this one here by @pulyaevskiy do not seem to get maintained anymore.

For more information about using the Dart Functions Framework for serverless Dart running in Cloud Run by for example also using triggers from Firestore and in advance literally every cloud service via EventArc just reach out to me.

blaueeiner avatar May 23 '21 19:05 blaueeiner

@blaueeiner Hey getting Functions Framework to work with Firestore triggers is exactly the kind of thing I'm trying to figure out. Do you have any resources you could point us towards, maybe an example function code or article, or basic tutorial? Would be amazing!

I've taken a look at EventArc's docs, but if there's any dart/flutter specific resource that would be awesome!

Thanks.

azambuilds avatar Jun 04 '21 05:06 azambuilds

@blaueeiner I would also be interested in an example on how to integrate Firestore triggers using the functions framework.

kaciula avatar Jul 07 '21 06:07 kaciula

@Tameflame @kaciula Firestore triggers in Eventarc are not supported yet, since "Firestore does not support audit logs for operations that read, write, and delete documents" yet. They will be available soon. You can read more about it here. The workaround would be to publish a Pub/Sub message from inside of lightweight Javascript/Typescript Firestore Triggered Cloud Functions, which will basically forward the trigger event to your Cloud Run service. The Cloud Run service should be configured to subscribe on the specific Pub/Sub topic.

blaueeiner avatar Jul 07 '21 09:07 blaueeiner