flutterfire
flutterfire copied to clipboard
feat(cloud_firestore): Create a `cloud_firestore_types` package that can be used in dart-only contexts
Description
I am working on Dart code that gets transpiled to javascript. I'm having issues compiling because my model classes use these types, and thus transitively depend on Flutter.
Prequel to https://github.com/firebase/flutterfire/pull/13216
Related Issues
https://github.com/firebase/flutterfire/issues/13214
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. Updating the pubspec.yaml and changelogs is not required.
- [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [x] My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
- [x] All existing and new tests are passing.
- [x] I updated/added relevant documentation (doc comments with
///). - [x] The analyzer (
melos run analyze) does not report any problems on my PR. - [x] I read and followed the Flutter Style Guide.
- [x] I signed the CLA.
- [x] I am willing to follow-up on review comments in a timely manner.
Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?
- [ ] Yes, this is a breaking change.
- [x] No, this is not a breaking change.
Meh I'm not sure this actually improves the state of things
Actually I think having these available would help with json serialization
Description
Je travaille sur du code Dart qui est transposé en javascript. J'ai des problèmes de compilation car mes classes de modèle utilisent ces types et dépendent donc de manière transitive de Flutter.
Préquelle de #13216
Questions connexes
#13214
Liste de contrĂ´le
Avant de créer cette demande de tirage, vérifiez qu'elle répond à toutes les exigences énumérées ci-dessous en cochant les cases correspondantes (
[x]). Cela garantira un processus de révision fluide et rapide. La mise à jour des journaux despubspec.yamlmodifications et des modifications n'est pas requise.
- [x] J'ai lu le Guide du contributeur et suivi le processus qui y est décrit pour soumettre des PR.
- [x] Mon PR inclut des tests unitaires ou d'intégration pour tous les comportements modifiés/mis à jour/corrigés (voir le Guide du contributeur ).
- [x] Tous les tests existants et nouveaux sont réussis.
- [x] J'ai mis à jour/ajouté la documentation pertinente (commentaires de documentation avec
///).- [x] L'analyseur (
melos run analyze) ne signale aucun problème sur mon PR.- [x] J'ai lu et suivi le guide de style Flutter .
- [x] J'ai signé le CLA .
- [x] Je suis disposé à donner suite aux commentaires d'évaluation dans les meilleurs délais.
Changement radical
Votre PR exige-t-il que les utilisateurs de plugins mettent à jour manuellement leurs applications pour s'adapter à votre changement ?
- [ ] Oui, c’est un changement radical.
- [x] Non, ce n’est pas un changement radical.
I would like to include DocumentReference in this package as well since that can be in model classes, but that class seems to be more complex. Would making a base class maybe work?
Hello @Rexios80, I'm not sure it will be used by other people and thus might not be useful to include it directly in the main FlutterFire repository. Would using a fork directly on your side be easier?
@Lyokone If cloud_firestore doesn't use the types from this package then it might as well not exist. I plan on using these in my own published packages, so it needs to be published as well. I'm working on firebase_js_interop which allows you to write Firebase Cloud Functions in Dart. I hope that would be a popular enough use-case to warrant this change. This isn't the first time I've run into this issue, but last time I found a workaround. Having a cloud_firestore_types package would allow me to remove the workaround package firebase_rules_convert.
I need to be able to create json converters from the cloud_firestore types to the js_interop types, but I can't do that since cloud_firestore depends on flutter.
@Lyokone Do you need anything from me on this?
Closing due to lack of interest. I still think this would be useful for dart-only firebase usage, so please let me know if you want to continue work on this.