Skip to content

Commit 2de74d6

Browse files
committed
alpha4 build (needs cleanup)
1 parent 65b0e24 commit 2de74d6

File tree

8 files changed

+24
-8
lines changed

8 files changed

+24
-8
lines changed

packages/firestore/externs.json

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"node_modules/typescript/lib/lib.es2015.core.d.ts",
1313
"node_modules/typescript/lib/lib.es2017.object.d.ts",
1414
"node_modules/typescript/lib/lib.es2017.string.d.ts",
15+
"node_modules/typescript/lib/lib.es2019.array.d.ts",
1516
"node_modules/re2js/build/index.esm.d.ts",
1617
"packages/app-types/index.d.ts",
1718
"packages/app-types/private.d.ts",

packages/firestore/pipelines/pipelines.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
import { PipelineSource, Pipeline } from '../dist/pipelines';
17+
import { PipelineSource, Pipeline, RealtimePipeline } from '../dist/pipelines';
1818

1919
// Augument the Firestore and Query classes with the pipeline() method.
2020
// This is stripped from dist/lite/pipelines.d.ts during the build
2121
// so it needs to be re-added here.
2222
declare module '@firebase/firestore' {
2323
interface Firestore {
2424
pipeline(): PipelineSource<Pipeline>;
25+
realtimePipeline(): PipelineSource<RealtimePipeline>;
2526
}
2627
}
2728

packages/firestore/rollup.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const browserPlugins = [
5656
transformers: [util.removeAssertAndPrefixInternalTransformer]
5757
}),
5858
json({ preferConst: true }),
59-
terser(util.manglePrivatePropertiesOptions)
59+
//terser(util.manglePrivatePropertiesOptions)
6060
];
6161

6262
const allBuilds = [

packages/firestore/rollup.shared.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ const publicIdentifiers = extractPublicIdentifiers(externsPaths);
108108
// manually add `_delegate` because we don't have typings for the compat package
109109
publicIdentifiers.add('_delegate');
110110

111+
// TODO these should not have to be added manually
112+
publicIdentifiers.add('pipeline');
113+
publicIdentifiers.add('realtimePipeline');
114+
publicIdentifiers.add('CorePipeline');
115+
publicIdentifiers.add('Constant');
116+
111117
/**
112118
* Transformers that remove calls to `debugAssert` and messages for 'fail` and
113119
* `hardAssert`.
@@ -125,10 +131,10 @@ exports.removeAssertTransformer = removeAssertTransformer;
125131
const removeAssertAndPrefixInternalTransformer = service => ({
126132
before: [
127133
removeAsserts(service.getProgram()),
128-
renameInternals(service.getProgram(), {
129-
publicIdentifiers,
130-
prefix: '__PRIVATE_'
131-
})
134+
// renameInternals(service.getProgram(), {
135+
// publicIdentifiers,
136+
// prefix: '__PRIVATE_'
137+
// })
132138
],
133139
after: []
134140
});

packages/firestore/src/core/pipeline.ts

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { debugAssert } from '../util/assert';
3030
import { PipelineFlavor, PipelineSourceType } from './pipeline-util';
3131

3232
export class CorePipeline {
33+
isCorePipeline = true;
3334
constructor(
3435
readonly serializer: JsonProtoSerializer,
3536
readonly stages: Stage[]

packages/firestore/src/core/target.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,12 @@ export function targetIsPipelineTarget(
221221
target: TargetOrPipeline
222222
): target is CorePipeline {
223223
// Workaround for circular dependency
224-
return target.constructor.name === 'CorePipeline';
224+
return !!(target as CorePipeline).isCorePipeline;
225225
}
226226

227227
export function targetIsDocumentTarget(target: Target): boolean {
228228
return (
229+
!!target.path &&
229230
DocumentKey.isDocumentKey(target.path) &&
230231
target.collectionGroup === null &&
231232
target.filters.length === 0

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

+6
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,15 @@ import { LiteUserDataWriter } from './reference_impl';
2727
import { Stage } from './stage';
2828
import { newUserDataReader } from './user_data_reader';
2929

30+
// TODO should not be in lite
31+
import { RealtimePipeline} from "../api/realtime_pipeline";
32+
3033
declare module './database' {
3134
interface Firestore {
3235
pipeline(): PipelineSource<Pipeline>;
36+
37+
// TODO should not be in lite
38+
realtimePipeline(): PipelineSource<RealtimePipeline>;
3339
}
3440
}
3541

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

+1-1
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).constructor.name === 'Constant') {
715+
if ((input as Constant).exprType === 'Constant') {
716716
return (input as Constant)._getValue();
717717
}
718718

0 commit comments

Comments
 (0)