Skip to content

Commit a9a0b82

Browse files
committed
Remove type references from the core Firestore API surface. This will support multiple entrypoints work.
1 parent 63b8854 commit a9a0b82

File tree

8 files changed

+25
-43
lines changed

8 files changed

+25
-43
lines changed

common/api-review/firestore-lite.api.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,8 +1056,6 @@ export interface FindNearestOptions {
10561056
// @public
10571057
export class Firestore {
10581058
get app(): FirebaseApp;
1059-
// Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta
1060-
pipeline(): PipelineSource;
10611059
toJSON(): object;
10621060
type: 'firestore-lite' | 'firestore';
10631061
}
@@ -1657,7 +1655,6 @@ export class Query<AppModelType = DocumentData, DbModelType extends DocumentData
16571655
protected constructor();
16581656
readonly converter: FirestoreDataConverter<AppModelType, DbModelType> | null;
16591657
readonly firestore: Firestore;
1660-
pipeline(): Pipeline;
16611658
readonly type: 'query' | 'collection';
16621659
withConverter(converter: null): Query<DocumentData, DocumentData>;
16631660
withConverter<NewAppModelType, NewDbModelType extends DocumentData = DocumentData>(converter: FirestoreDataConverter<NewAppModelType, NewDbModelType>): Query<NewAppModelType, NewDbModelType>;
@@ -2208,8 +2205,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor;
22082205

22092206
// Warnings were encountered during analysis:
22102207
//
2211-
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9248:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta
2212-
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9249:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta
2213-
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9278:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta
2208+
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9244:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta
2209+
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9245:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta
2210+
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9274:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta
22142211

22152212
```

common/api-review/firestore.api.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,8 +1119,6 @@ export interface FindNearestOptions {
11191119
// @public
11201120
export class Firestore {
11211121
get app(): FirebaseApp;
1122-
// Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta
1123-
pipeline(): PipelineSource;
11241122
toJSON(): object;
11251123
type: 'firestore-lite' | 'firestore';
11261124
}
@@ -1925,7 +1923,6 @@ export class Query<AppModelType = DocumentData, DbModelType extends DocumentData
19251923
protected constructor();
19261924
readonly converter: FirestoreDataConverter<AppModelType, DbModelType> | null;
19271925
readonly firestore: Firestore;
1928-
pipeline(): Pipeline;
19291926
readonly type: 'query' | 'collection';
19301927
withConverter(converter: null): Query<DocumentData, DocumentData>;
19311928
withConverter<NewAppModelType, NewDbModelType extends DocumentData = DocumentData>(converter: FirestoreDataConverter<NewAppModelType, NewDbModelType>): Query<NewAppModelType, NewDbModelType>;
@@ -2512,8 +2509,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor;
25122509

25132510
// Warnings were encountered during analysis:
25142511
//
2515-
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10177:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta
2516-
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10177:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta
2517-
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10204:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta
2512+
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10173:26 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta
2513+
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10173:61 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta
2514+
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10200:21 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta
25182515

25192516
```

packages/firestore/src/api/database.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import {
4646
connectFirestoreEmulator,
4747
Firestore as LiteFirestore
4848
} from '../lite-api/database';
49-
import type { PipelineSource } from '../lite-api/pipeline-source';
5049
import { Query } from '../lite-api/reference';
5150
import {
5251
indexedDbClearPersistence,
@@ -129,15 +128,6 @@ export class Firestore extends LiteFirestore {
129128
await terminate;
130129
}
131130
}
132-
133-
/**
134-
* Pipeline query.
135-
*/
136-
pipeline(): PipelineSource {
137-
throw new Error(
138-
'Pipelines not initialized. Your application must call `useFluentPipelines()` before using Firestore Pipeline features.'
139-
);
140-
}
141131
}
142132

143133
/**

packages/firestore/src/api/pipeline_impl.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ import { Firestore, ensureFirestoreConfigured } from './database';
2828
import { DocumentReference, Query } from './reference';
2929
import { ExpUserDataWriter } from './user_data_writer';
3030

31+
declare module './database' {
32+
interface Firestore {
33+
pipeline(): PipelineSource;
34+
}
35+
}
36+
3137
/**
3238
* Experimental Modular API for console testing.
3339
* @param firestore

packages/firestore/src/lite-api/database.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import { logWarn } from '../util/log';
4343
import { FirestoreService, removeComponents } from './components';
4444
// `import type` to avoid bundling the source for
4545
// pipelines if `useFluentPipelines()` is not called
46-
import type { PipelineSource } from './pipeline-source';
4746
import {
4847
DEFAULT_HOST,
4948
FirestoreSettingsImpl,
@@ -176,15 +175,6 @@ export class Firestore implements FirestoreService {
176175
removeComponents(this);
177176
return Promise.resolve();
178177
}
179-
180-
/**
181-
* Pipeline query.
182-
*/
183-
pipeline(): PipelineSource {
184-
throw new Error(
185-
'Pipelines not initialized. Your application must call `useFluentPipelines()` before using Firestore Pipeline features.'
186-
);
187-
}
188178
}
189179

190180
/**

packages/firestore/src/lite-api/pipeline_impl.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ import { DocumentReference, Query } from './reference';
2727
import { LiteUserDataWriter } from './reference_impl';
2828
import { newUserDataReader } from './user_data_reader';
2929

30+
declare module './database' {
31+
interface Firestore {
32+
pipeline(): PipelineSource;
33+
}
34+
}
35+
36+
declare module './reference' {
37+
interface Query {
38+
pipeline(): Pipeline;
39+
}
40+
}
41+
3042
/**
3143
* Modular API for console experimentation.
3244
* @param pipeline Execute this pipeline.

packages/firestore/src/lite-api/reference.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import { AutoId } from '../util/misc';
3737
import { Firestore } from './database';
3838
import { FieldPath } from './field_path';
3939
import { FieldValue } from './field_value';
40-
import type { Pipeline } from './pipeline';
4140
import { FirestoreDataConverter } from './snapshot';
4241
import { NestedUpdateFields, Primitive } from './types';
4342

@@ -178,15 +177,6 @@ export class Query<
178177
this._query
179178
);
180179
}
181-
182-
/**
183-
* Pipeline query.
184-
*/
185-
pipeline(): Pipeline {
186-
throw new Error(
187-
'Pipelines not initialized. Your application must call `useFluentPipelines()` before using Firestore Pipeline features.'
188-
);
189-
}
190180
}
191181

192182
/**

packages/firestore/test/integration/api/pipeline.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ use(chaiAsPromised);
6969

7070
setLogLevel('debug');
7171

72-
apiDescribe.only('Pipelines', persistence => {
72+
apiDescribe('Pipelines', persistence => {
7373
addEqualityMatcher();
7474
let firestore: Firestore;
7575
let randomCol: CollectionReference;

0 commit comments

Comments
 (0)