Skip to content

Commit 3ce820b

Browse files
committed
Fix compilation and tests failures
1 parent a8d937b commit 3ce820b

File tree

15 files changed

+50
-97
lines changed

15 files changed

+50
-97
lines changed

packages/firestore/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const browserPlugins = [
5555
abortOnError: true,
5656
transformers: [util.removeAssertAndPrefixInternalTransformer]
5757
}),
58-
json({ preferConst: true }),
58+
json({ preferConst: true })
5959
//terser(util.manglePrivatePropertiesOptions)
6060
];
6161

packages/firestore/rollup.shared.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ exports.removeAssertTransformer = removeAssertTransformer;
130130
*/
131131
const removeAssertAndPrefixInternalTransformer = service => ({
132132
before: [
133-
removeAsserts(service.getProgram()),
133+
removeAsserts(service.getProgram())
134134
// renameInternals(service.getProgram(), {
135135
// publicIdentifiers,
136136
// prefix: '__PRIVATE_'

packages/firestore/src/api/pipeline_impl.ts

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -87,31 +87,16 @@ declare module './database' {
8787
* @param pipeline The pipeline to execute.
8888
* @return A Promise representing the asynchronous pipeline execution.
8989
*/
90-
export function execute(pipeline: LitePipeline): Promise<PipelineSnapshot>;
91-
export function execute(
92-
pipeline: RealtimePipeline
93-
): Promise<RealtimePipelineSnapshot>;
94-
export function execute(
95-
pipeline: LitePipeline | RealtimePipeline
96-
): Promise<PipelineSnapshot | RealtimePipelineSnapshot> {
90+
export function execute(pipeline: LitePipeline): Promise<PipelineSnapshot> {
9791
const firestore = cast(pipeline._db, Firestore);
9892
const client = ensureFirestoreConfigured(firestore);
9993

100-
if (pipeline instanceof RealtimePipeline) {
101-
return firestoreClientGetDocumentsViaSnapshotListener(
102-
client,
103-
pipeline
104-
).then(
105-
snapshot =>
106-
new RealtimePipelineSnapshot(pipeline as RealtimePipeline, snapshot)
107-
);
108-
} else {
109-
return firestoreClientExecutePipeline(client, pipeline).then(result => {
110-
// Get the execution time from the first result.
111-
// firestoreClientExecutePipeline returns at least one PipelineStreamElement
112-
// even if the returned document set is empty.
113-
const executionTime =
114-
result.length > 0 ? result[0].executionTime?.toTimestamp() : undefined;
94+
return firestoreClientExecutePipeline(client, pipeline).then(result => {
95+
// Get the execution time from the first result.
96+
// firestoreClientExecutePipeline returns at least one PipelineStreamElement
97+
// even if the returned document set is empty.
98+
const executionTime =
99+
result.length > 0 ? result[0].executionTime?.toTimestamp() : undefined;
115100

116101
const docs = result
117102
// Currently ignore any response from ExecutePipeline that does
@@ -131,9 +116,8 @@ export function execute(
131116
)
132117
);
133118

134-
return new PipelineSnapshot(pipeline, docs, executionTime);
135-
});
136-
}
119+
return new PipelineSnapshot(pipeline, docs, executionTime);
120+
});
137121
}
138122

139123
// Augment the Firestore class with the pipeline() factory method

packages/firestore/src/api/snapshot.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { newQueryComparator } from '../core/query';
2222
import { ChangeType, ViewSnapshot } from '../core/view_snapshot';
2323
import { FieldPath } from '../lite-api/field_path';
2424
import { PipelineResult, toPipelineResult } from '../lite-api/pipeline-result';
25-
import { PipelineResult, toPipelineResult } from '../lite-api/pipeline-result';
2625
import {
2726
DocumentData,
2827
DocumentReference,

packages/firestore/src/core/expressions.ts

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export class CoreField implements EvaluableExpr {
326326
});
327327
}
328328
// Return 'UNSET' if the field doesn't exist, otherwise the Value.
329-
const result = input.data.field(this.expr.fieldPath);
329+
const result = input.data.field(this.expr._fieldPath);
330330
if (!!result) {
331331
return EvaluateResult.newValue(result);
332332
} else {
@@ -367,38 +367,6 @@ export class CoreListOfExprs implements EvaluableExpr {
367367
}
368368
}
369369

370-
export class CoreListOfExprs implements EvaluableExpr {
371-
constructor(private expr: ListOfExprs) {}
372-
373-
evaluate(
374-
context: EvaluationContext,
375-
input: PipelineInputOutput
376-
): EvaluateResult {
377-
return EvaluateResult.newValue(this.expr._getValue());
378-
}
379-
}
380-
381-
export class CoreListOfExprs implements EvaluableExpr {
382-
constructor(private expr: ListOfExprs) {}
383-
384-
evaluate(
385-
context: EvaluationContext,
386-
input: PipelineInputOutput
387-
): EvaluateResult {
388-
const results: EvaluateResult[] = this.expr.exprs.map(expr =>
389-
toEvaluable(expr).evaluate(context, input)
390-
);
391-
// If any sub-expression resulted in error or was unset, the list evaluation fails.
392-
if (results.some(value => value.isErrorOrUnset())) {
393-
return EvaluateResult.newError();
394-
}
395-
396-
return EvaluateResult.newValue({
397-
arrayValue: { values: results.map(value => value.value!) }
398-
});
399-
}
400-
}
401-
402370
function asDouble(
403371
protoNumber:
404372
| { doubleValue: number | string }
@@ -2576,8 +2544,6 @@ export class CoreUnixMicrosToTimestamp extends UnixToTimestamp {
25762544
const nanos = Number((value % MICROSECONDS_PER_SECOND) * BigInt(1000));
25772545
return EvaluateResult.newValue({ timestampValue: { seconds, nanos } });
25782546
}
2579-
2580-
abstract toTimestamp(value: bigint): Value | undefined;
25812547
}
25822548

25832549
export class CoreUnixMillisToTimestamp extends UnixToTimestamp {

packages/firestore/src/core/pipeline-util.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { RealtimePipeline } from '../api/realtime_pipeline';
1918
import { RealtimePipeline } from '../api/realtime_pipeline';
2019
import { Firestore } from '../lite-api/database';
2120
import {
@@ -37,7 +36,7 @@ import {
3736
AggregateFunction
3837
} from '../lite-api/expressions';
3938
import { Pipeline, Pipeline as ApiPipeline } from '../lite-api/pipeline';
40-
import { doc } from '../lite-api/reference';
39+
import { doc, DocumentReference } from '../lite-api/reference';
4140
import {
4241
AddFields,
4342
Aggregate,

packages/firestore/src/core/sync_engine_impl.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ import { ListenSequence } from './listen_sequence';
9191
import { getPipelineCollectionId, getPipelineSourceType } from './pipeline';
9292
import {
9393
canonifyQueryOrPipeline,
94-
getPipelineCollectionId,
95-
getPipelineSourceType,
9694
isPipeline,
9795
QueryOrPipeline,
9896
queryOrPipelineEqual,

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { RealtimePipeline } from '../api/realtime_pipeline';
1918
import { invokeExecutePipeline } from '../remote/datastore';
2019

2120
import { getDatastore } from './components';
@@ -28,9 +27,6 @@ import { LiteUserDataWriter } from './reference_impl';
2827
import { Stage } from './stage';
2928
import { newUserDataReader } from './user_data_reader';
3029

31-
// TODO should not be in lite
32-
import { RealtimePipeline} from "../api/realtime_pipeline";
33-
3430
declare module './database' {
3531
interface Firestore {
3632
pipeline(): PipelineSource<Pipeline>;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ export function parseData(
712712
input = getModularInstance(input);
713713

714714
// Workaround for circular dependency
715-
if ((input as Constant).exprType === 'Constant') {
715+
if ((input as Constant)?.exprType === 'Constant') {
716716
return (input as Constant)._getValue();
717717
}
718718

packages/firestore/src/local/local_store_impl.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,15 @@
1818
import { User } from '../auth/user';
1919
import { BundleConverter, BundledDocuments, NamedQuery } from '../core/bundle';
2020
import { CorePipeline, getPipelineDocuments } from '../core/pipeline';
21+
2122
import {
2223
canonifyTargetOrPipeline,
2324
isPipeline,
2425
QueryOrPipeline,
2526
TargetOrPipeline,
2627
targetOrPipelineEqual
2728
} from '../core/pipeline-util';
28-
import {
29-
canonifyTargetOrPipeline,
30-
getPipelineDocuments,
31-
isPipeline,
32-
QueryOrPipeline,
33-
TargetOrPipeline,
34-
targetOrPipelineEqual
35-
} from '../core/pipeline-util';
36-
import { CorePipeline } from '../core/pipeline_run';
29+
3730
import {
3831
newQueryForPath,
3932
queryCollectionGroup,

0 commit comments

Comments
 (0)