Skip to content

Commit a1ce708

Browse files
Merge branch 'master' into performance-example-app
2 parents 9ccb7d5 + 2fd0e40 commit a1ce708

File tree

32 files changed

+1149
-624
lines changed

32 files changed

+1149
-624
lines changed

melos.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ command:
1616

1717
changelogs:
1818
- path: firebase_ui_changelog.md
19-
scope: firebase_ui_*
19+
packageFilters:
20+
scope: firebase_ui_*
2021
description: |
2122
All notable changes for firebase_ui packages
2223

packages/cloud_firestore/cloud_firestore/example/integration_test/instance_e2e.dart

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
import 'dart:async';
6+
import 'dart:convert';
67

78
import 'package:flutter/foundation.dart';
89
import 'package:flutter_test/flutter_test.dart';
@@ -229,6 +230,30 @@ void runInstanceTests() {
229230
fieldOverrides: [fieldOverride1, fieldOverride2],
230231
);
231232
});
233+
234+
test('setIndexConfigurationFromJSON()', () async {
235+
final json = jsonEncode({
236+
'indexes': [
237+
{
238+
'collectionGroup': 'posts',
239+
'queryScope': 'COLLECTION',
240+
'fields': [
241+
{'fieldPath': 'author', 'arrayConfig': 'CONTAINS'},
242+
{'fieldPath': 'timestamp', 'order': 'DESCENDING'}
243+
]
244+
}
245+
],
246+
'fieldOverrides': [
247+
{
248+
'collectionGroup': 'posts',
249+
'fieldPath': 'myBigMapField',
250+
'indexes': []
251+
}
252+
]
253+
});
254+
255+
await firestore.setIndexConfigurationFromJSON(json);
256+
});
232257
},
233258
);
234259
}

packages/cloud_firestore/cloud_firestore/lib/src/firestore.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,20 @@ class FirebaseFirestore extends FirebasePluginPlatform {
323323
return _delegate.setIndexConfiguration(json);
324324
}
325325

326+
/// Configures indexing for local query execution. Any previous index configuration is overridden.
327+
///
328+
/// The index entries themselves are created asynchronously. You can continue to use queries that
329+
/// require indexing even if the indices are not yet available. Query execution will automatically
330+
/// start using the index once the index entries have been written.
331+
/// See Firebase documentation to learn how to configure your index configuration JSON file:
332+
/// https://firebase.google.com/docs/reference/firestore/indexes
333+
///
334+
/// This API is in preview mode and is subject to change.
335+
@experimental
336+
Future<void> setIndexConfigurationFromJSON(String json) async {
337+
return _delegate.setIndexConfiguration(json);
338+
}
339+
326340
@override
327341
// ignore: avoid_equals_and_hash_code_on_mutable_classes
328342
bool operator ==(Object other) =>

packages/cloud_firestore/cloud_firestore_web/lib/src/interop/firestore.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,14 @@ class Firestore extends JsObjectWrapper<firestore_interop.FirestoreJsImpl> {
6363
firestore_interop.doc(jsObject, documentPath));
6464

6565
Future<void> enablePersistence(
66-
[firestore_interop.PersistenceSettings? settings]) =>
67-
handleThenable(
68-
firestore_interop.enableIndexedDbPersistence(jsObject, settings));
66+
[firestore_interop.PersistenceSettings? settings]) {
67+
if (settings != null && settings.synchronizeTabs == true) {
68+
return handleThenable(
69+
firestore_interop.enableMultiTabIndexedDbPersistence(jsObject));
70+
}
71+
return handleThenable(
72+
firestore_interop.enableIndexedDbPersistence(jsObject));
73+
}
6974

7075
Stream<void> snapshotsInSync() {
7176
late StreamController<void> controller;

packages/cloud_firestore/cloud_firestore_web/lib/src/interop/firestore_interop.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ external PromiseJsImpl<void> enableIndexedDbPersistence(
8585

8686
@JS()
8787
external PromiseJsImpl<void> enableMultiTabIndexedDbPersistence(
88-
FirestoreJsImpl firestore);
88+
FirestoreJsImpl firestore,
89+
);
8990

9091
@JS()
9192
external PromiseJsImpl<void> enableNetwork(FirestoreJsImpl firestore);

packages/firebase_auth/firebase_auth/example/android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ android {
4343

4444
defaultConfig {
4545
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46-
applicationId "io.flutter.plugins.firebaseauthexample"
46+
applicationId "io.flutter.plugins.firebase.auth.example"
4747
minSdkVersion 19
4848
targetSdkVersion flutter.targetSdkVersion
4949
versionCode flutterVersionCode.toInteger()
@@ -69,4 +69,4 @@ dependencies {
6969
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
7070
}
7171

72-
apply plugin: 'com.google.gms.google-services'
72+
apply plugin: 'com.google.gms.google-services'

0 commit comments

Comments
 (0)