Skip to content

Commit 2e1c8f6

Browse files
committed
Remove converter and placeholders for converter.
1 parent 8b03745 commit 2e1c8f6

File tree

6 files changed

+46
-155
lines changed

6 files changed

+46
-155
lines changed

packages/firestore/src/api/pipeline.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {firestoreClientExecutePipeline} from "../core/firestore_client";
2929

3030
export class Pipeline<
3131
AppModelType = DocumentData
32-
> extends LitePipeline<AppModelType> {
32+
> extends LitePipeline {
3333
/**
3434
* @internal
3535
* @private
@@ -38,25 +38,20 @@ export class Pipeline<
3838
* @param userDataWriter
3939
* @param documentReferenceFactory
4040
* @param stages
41-
* @param converter
4241
*/
4342
constructor(
4443
db: Firestore,
4544
userDataReader: UserDataReader,
4645
userDataWriter: AbstractUserDataWriter,
4746
documentReferenceFactory: (id: DocumentKey) => DocumentReference,
48-
stages: Stage[],
49-
// TODO(pipeline) support converter
50-
//private converter: FirestorePipelineConverter<AppModelType> = defaultPipelineConverter()
51-
converter: unknown = {}
47+
stages: Stage[]
5248
) {
5349
super(
5450
db,
5551
userDataReader,
5652
userDataWriter,
5753
documentReferenceFactory,
58-
stages,
59-
converter
54+
stages
6055
);
6156
}
6257

@@ -78,14 +73,13 @@ export class Pipeline<
7873
documentReferenceFactory: (id: DocumentKey) => DocumentReference,
7974
stages: Stage[],
8075
converter: unknown = {}
81-
): Pipeline<AppModelType> {
82-
return new Pipeline<AppModelType>(
76+
): Pipeline {
77+
return new Pipeline(
8378
db,
8479
userDataReader,
8580
userDataWriter,
8681
documentReferenceFactory,
87-
stages,
88-
converter
82+
stages
8983
);
9084
}
9185

@@ -120,7 +114,7 @@ export class Pipeline<
120114
*
121115
* @return A Promise representing the asynchronous pipeline execution.
122116
*/
123-
execute(): Promise<Array<PipelineResult<AppModelType>>> {
117+
execute(): Promise<Array<PipelineResult>> {
124118
const firestore = cast(this._db, Firestore);
125119
const client = ensureFirestoreConfigured(firestore);
126120
return firestoreClientExecutePipeline(client, this).then(result => {
@@ -130,7 +124,7 @@ export class Pipeline<
130124
.filter(element => !!element.fields)
131125
.map(
132126
element =>
133-
new PipelineResult<AppModelType>(
127+
new PipelineResult(
134128
this._userDataWriter,
135129
element.key?.path
136130
? this._documentReferenceFactory(element.key)
@@ -139,7 +133,6 @@ export class Pipeline<
139133
element.executionTime?.toTimestamp(),
140134
element.createTime?.toTimestamp(),
141135
element.updateTime?.toTimestamp()
142-
//this.converter
143136
)
144137
);
145138

packages/firestore/src/core/firestore_client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ export function firestoreClientRunAggregateQuery(
557557

558558
export function firestoreClientExecutePipeline(
559559
client: FirestoreClient,
560-
pipeline: Pipeline<unknown>
560+
pipeline: Pipeline
561561
): Promise<PipelineStreamElement[]> {
562562
const deferred = new Deferred<PipelineStreamElement[]>();
563563

packages/firestore/src/lite-api/pipeline-result.ts

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ export class PipelineResult<AppModelType = DocumentData> {
7272
executionTime?: Timestamp,
7373
createTime?: Timestamp,
7474
updateTime?: Timestamp
75-
// TODO converter
76-
//readonly converter: FirestorePipelineConverter<AppModelType> = defaultPipelineConverter()
7775
) {
7876
this._ref = ref;
7977
this._userDataWriter = userDataWriter;
@@ -160,26 +158,9 @@ export class PipelineResult<AppModelType = DocumentData> {
160158
return undefined;
161159
}
162160

163-
// TODO(pipelines)
164-
// We only want to use the converter and create a new QueryDocumentSnapshot
165-
// if a converter has been provided.
166-
// if (!!this.converter && this.converter !== defaultPipelineConverter()) {
167-
// return this.converter.fromFirestore(
168-
// new PipelineResult< DocumentData>(
169-
// this._serializer,
170-
// this.ref,
171-
// this._fieldsProto,
172-
// this._executionTime,
173-
// this.createTime,
174-
// this.updateTime,
175-
// defaultPipelineConverter()
176-
// )
177-
// );
178-
// } else {{
179161
return this._userDataWriter.convertValue(
180162
this._fields.value
181163
) as AppModelType;
182-
//}
183164
}
184165

185166
/**
@@ -217,9 +198,9 @@ export class PipelineResult<AppModelType = DocumentData> {
217198
}
218199
}
219200

220-
export function pipelineResultEqual<AppModelType>(
221-
left: PipelineResult<AppModelType>,
222-
right: PipelineResult<AppModelType>
201+
export function pipelineResultEqual(
202+
left: PipelineResult,
203+
right: PipelineResult
223204
): boolean {
224205
if (left === right) {
225206
return true;

0 commit comments

Comments
 (0)