@firebase/firestore 1.14.0-canary.daf63c2c → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist/index.esm2017.d.ts +2 -2
- package/dist/dist/index.memory.esm2017.d.ts +2 -2
- package/dist/index.cjs.js +872 -874
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +933 -935
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm2017.js +746 -780
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.memory.cjs.js +604 -651
- package/dist/index.memory.cjs.js.map +1 -1
- package/dist/index.memory.esm.js +882 -929
- package/dist/index.memory.esm.js.map +1 -1
- package/dist/index.memory.esm2017.js +387 -422
- package/dist/index.memory.esm2017.js.map +1 -1
- package/dist/index.memory.node.cjs.js +21 -81
- package/dist/index.memory.node.cjs.js.map +1 -1
- package/dist/index.memory.node.esm2017.js +19 -64
- package/dist/index.memory.node.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +110 -117
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.esm2017.js +66 -96
- package/dist/index.node.esm2017.js.map +1 -1
- package/dist/lib/src/core/component_provider.d.ts +19 -35
- package/dist/lib/src/local/indexeddb_persistence.d.ts +2 -2
- package/dist/lib/src/local/memory_persistence.d.ts +0 -1
- package/dist/lib/src/local/persistence.d.ts +0 -2
- package/dist/src/core/component_provider.d.ts +19 -35
- package/dist/src/local/indexeddb_persistence.d.ts +2 -2
- package/dist/src/local/memory_persistence.d.ts +0 -1
- package/dist/src/local/persistence.d.ts +0 -2
- package/package.json +12 -12
|
@@ -10424,9 +10424,6 @@ class MemoryPersistence {
|
|
|
10424
10424
|
this.indexManager = new MemoryIndexManager();
|
|
10425
10425
|
this.remoteDocumentCache = new MemoryRemoteDocumentCache(this.indexManager, sizer);
|
|
10426
10426
|
}
|
|
10427
|
-
start() {
|
|
10428
|
-
return Promise.resolve();
|
|
10429
|
-
}
|
|
10430
10427
|
shutdown() {
|
|
10431
10428
|
// No durable state to ensure is closed on shutdown.
|
|
10432
10429
|
this._started = false;
|
|
@@ -10598,61 +10595,28 @@ const MEMORY_ONLY_PERSISTENCE_ERROR_MESSAGE = 'You are using the memory-only bui
|
|
|
10598
10595
|
'firebase-firestore.js build.';
|
|
10599
10596
|
/**
|
|
10600
10597
|
* Provides all components needed for Firestore with in-memory persistence.
|
|
10601
|
-
* Uses EagerGC garbage collection.
|
|
10602
10598
|
*/
|
|
10603
10599
|
class MemoryComponentProvider {
|
|
10604
|
-
|
|
10605
|
-
this.
|
|
10606
|
-
|
|
10607
|
-
|
|
10608
|
-
|
|
10609
|
-
|
|
10610
|
-
|
|
10611
|
-
this.
|
|
10612
|
-
this.
|
|
10613
|
-
this.sharedClientState
|
|
10600
|
+
constructor(referenceDelegateFactory = MemoryEagerDelegate.factory) {
|
|
10601
|
+
this.referenceDelegateFactory = referenceDelegateFactory;
|
|
10602
|
+
}
|
|
10603
|
+
async initialize(asyncQueue, databaseInfo, platform, datastore, clientId, initialUser, maxConcurrentLimboResolutions, persistenceSettings) {
|
|
10604
|
+
if (persistenceSettings.durable) {
|
|
10605
|
+
throw new FirestoreError(Code.FAILED_PRECONDITION, MEMORY_ONLY_PERSISTENCE_ERROR_MESSAGE);
|
|
10606
|
+
}
|
|
10607
|
+
this.persistence = new MemoryPersistence(clientId, this.referenceDelegateFactory);
|
|
10608
|
+
this.gcScheduler = null;
|
|
10609
|
+
this.sharedClientState = new MemorySharedClientState();
|
|
10610
|
+
this.localStore = new LocalStore(this.persistence, new IndexFreeQueryEngine(), initialUser);
|
|
10611
|
+
this.remoteStore = new RemoteStore(this.localStore, datastore, asyncQueue, onlineState => this.syncEngine.applyOnlineStateChange(onlineState, 0 /* RemoteStore */), platform.newConnectivityMonitor());
|
|
10612
|
+
this.syncEngine = new SyncEngine(this.localStore, this.remoteStore, this.sharedClientState, initialUser, maxConcurrentLimboResolutions);
|
|
10613
|
+
this.eventManager = new EventManager(this.syncEngine);
|
|
10614
10614
|
this.remoteStore.syncEngine = this.syncEngine;
|
|
10615
|
-
this.sharedClientState.syncEngine = this.syncEngine;
|
|
10616
|
-
await this.sharedClientState.start();
|
|
10617
10615
|
await this.remoteStore.start();
|
|
10618
|
-
await this.
|
|
10619
|
-
|
|
10620
|
-
// set it after localStore / remoteStore are started.
|
|
10621
|
-
await this.persistence.setPrimaryStateListener(async (isPrimary) => {
|
|
10622
|
-
await this.syncEngine.applyPrimaryState(isPrimary);
|
|
10623
|
-
if (this.gcScheduler) {
|
|
10624
|
-
if (isPrimary && !this.gcScheduler.started) {
|
|
10625
|
-
this.gcScheduler.start(this.localStore);
|
|
10626
|
-
}
|
|
10627
|
-
else if (!isPrimary) {
|
|
10628
|
-
this.gcScheduler.stop();
|
|
10629
|
-
}
|
|
10630
|
-
}
|
|
10631
|
-
});
|
|
10632
|
-
}
|
|
10633
|
-
createEventManager(cfg) {
|
|
10634
|
-
return new EventManager(this.syncEngine);
|
|
10616
|
+
await this.remoteStore.applyPrimaryState(true);
|
|
10617
|
+
await this.syncEngine.applyPrimaryState(true);
|
|
10635
10618
|
}
|
|
10636
|
-
|
|
10637
|
-
return null;
|
|
10638
|
-
}
|
|
10639
|
-
createLocalStore(cfg) {
|
|
10640
|
-
return new LocalStore(this.persistence, new IndexFreeQueryEngine(), cfg.initialUser);
|
|
10641
|
-
}
|
|
10642
|
-
createPersistence(cfg) {
|
|
10643
|
-
debugAssert(!cfg.persistenceSettings.durable, 'Can only start memory persistence');
|
|
10644
|
-
return new MemoryPersistence(cfg.clientId, MemoryEagerDelegate.factory);
|
|
10645
|
-
}
|
|
10646
|
-
createRemoteStore(cfg) {
|
|
10647
|
-
return new RemoteStore(this.localStore, cfg.datastore, cfg.asyncQueue, onlineState => this.syncEngine.applyOnlineStateChange(onlineState, 0 /* RemoteStore */), cfg.platform.newConnectivityMonitor());
|
|
10648
|
-
}
|
|
10649
|
-
createSharedClientState(cfg) {
|
|
10650
|
-
return new MemorySharedClientState();
|
|
10651
|
-
}
|
|
10652
|
-
createSyncEngine(cfg) {
|
|
10653
|
-
return new SyncEngine(this.localStore, this.remoteStore, this.sharedClientState, cfg.initialUser, cfg.maxConcurrentLimboResolutions);
|
|
10654
|
-
}
|
|
10655
|
-
clearPersistence(databaseInfo) {
|
|
10619
|
+
clearPersistence() {
|
|
10656
10620
|
throw new FirestoreError(Code.FAILED_PRECONDITION, MEMORY_ONLY_PERSISTENCE_ERROR_MESSAGE);
|
|
10657
10621
|
}
|
|
10658
10622
|
}
|
|
@@ -11357,16 +11321,7 @@ class FirestoreClient {
|
|
|
11357
11321
|
const connection = await this.platform.loadConnection(this.databaseInfo);
|
|
11358
11322
|
const serializer = this.platform.newSerializer(this.databaseInfo.databaseId);
|
|
11359
11323
|
const datastore = new Datastore(this.asyncQueue, connection, this.credentials, serializer);
|
|
11360
|
-
await componentProvider.initialize(
|
|
11361
|
-
asyncQueue: this.asyncQueue,
|
|
11362
|
-
databaseInfo: this.databaseInfo,
|
|
11363
|
-
platform: this.platform,
|
|
11364
|
-
datastore,
|
|
11365
|
-
clientId: this.clientId,
|
|
11366
|
-
initialUser: user,
|
|
11367
|
-
maxConcurrentLimboResolutions: MAX_CONCURRENT_LIMBO_RESOLUTIONS,
|
|
11368
|
-
persistenceSettings
|
|
11369
|
-
});
|
|
11324
|
+
await componentProvider.initialize(this.asyncQueue, this.databaseInfo, this.platform, datastore, this.clientId, user, MAX_CONCURRENT_LIMBO_RESOLUTIONS, persistenceSettings);
|
|
11370
11325
|
this.persistence = componentProvider.persistence;
|
|
11371
11326
|
this.sharedClientState = componentProvider.sharedClientState;
|
|
11372
11327
|
this.localStore = componentProvider.localStore;
|
|
@@ -16514,7 +16469,7 @@ class NodePlatform {
|
|
|
16514
16469
|
PlatformSupport.setPlatform(new NodePlatform());
|
|
16515
16470
|
|
|
16516
16471
|
var name = "@firebase/firestore";
|
|
16517
|
-
var version = "1.14.0
|
|
16472
|
+
var version = "1.14.0";
|
|
16518
16473
|
|
|
16519
16474
|
/**
|
|
16520
16475
|
* @license
|