-
Notifications
You must be signed in to change notification settings - Fork 985
Unify Pipelines and Firestore classic in CDN and g3 builds #9323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: console
Are you sure you want to change the base?
Changes from 11 commits
e8865f2
5887660
202c732
faaeb48
14d9721
5718838
d18310a
edb4001
648de84
ab8eb26
dcc62c0
b180898
6cc2ee6
670eba6
fb5d422
dd19924
195d943
61f0102
c8cbfff
4b34983
933ba9d
88a8055
8e9fdbe
1df3d26
609d082
66a09f2
3d6bbf3
32ee331
7532899
bb8fc27
b332825
4e0f630
ed0803a
03eb22e
e055e90
8bb66c2
0cbff6b
1363ecc
a0bcc9a
20b45d3
b204e71
9952dbc
0e2558a
dd6a8f0
ea1f913
1645cd6
0e12766
080a90d
136bb73
6a02778
3789b5a
f7ec278
d5428f3
51e7b48
9900a6a
f8334ea
050c1b6
e99683b
88584fd
8a03143
6be75f7
d5082f9
72852e1
39505cc
8593fa0
bf8c3d1
f92069a
3a203e6
799de59
9338d9d
9bcd1ea
1e91c24
8601ecb
a5bacaf
5b53905
3d9291f
880110b
e4297f7
2fe7547
35ad526
e96410a
b5df4ae
4ead831
770e455
9964849
d5e5795
ec91a86
8cb21ff
40be2db
1933324
af9f8b5
30de503
9be10d9
89051ca
d590889
5871fd6
6cc9a07
c0617a3
0f891d8
2306920
db2c5a5
a058309
7fb64dd
41bde42
13e6cce
b97eab3
41e3c4c
f73e08b
42ac401
bb57947
7ae5b12
86155b3
bd06146
3d44792
33a4a2d
3c759f0
5d13166
247b92f
8072572
ab5c2a0
a029ce3
ae976d0
a4ccd25
91fa484
47b154c
6ab4e13
ec5f374
e59cd7d
2b57312
f11b552
2d72099
d91169f
cb19688
5200f7b
25b60fd
a9be675
325d05e
f18b25f
08f474c
9771bff
c1e928a
5748005
52c8579
56fbe52
a4897a6
b9209dc
4923537
e25317f
b4d65ab
44d8d74
cc605e7
5501791
2058432
02280d7
9b63cd6
84b8bed
c5f08a9
cbef6c6
984086b
72b43d0
f2ecae7
095c098
3d07bad
4d834de
a4848b4
55f3f83
06ab5c4
120a308
9b8ab02
43276b0
c123766
37f9ef5
6ab71fa
8d3211b
cb3bdd8
1bcf83d
0ffcb26
7a7634f
ea85128
0bb2fe6
ccbf7ba
2802f8a
2596dd1
c1ffe3e
c407cb9
b7e18d0
beda76e
3456581
d34d930
2615081
a11ea79
d175049
5fb6ebe
c8263c4
d705208
31535d9
a78b761
cdfc931
54a17c6
81698f9
adba599
6251400
44d9891
91c218d
22e0a1a
637027a
8209266
0ec6389
bc5a7c4
07ca9c6
0b2845a
e397749
6e0e303
319a396
0aca735
5623923
3f8d12e
3dc7b96
d571641
1f44435
63167c6
c47bd71
8512f64
29e1965
f607f00
d3eed35
5206828
659ee21
7fea6f4
8561514
f9c4cde
0800a8b
e4cdd2e
f4c72a7
20c7bdb
6abe529
f06cbf9
5c35f51
ca4a66c
180b1ad
48c7dcd
b228a2a
c77c9df
578686b
2a895ba
6d76280
f817c54
299f614
a4685f6
5a760b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /** | ||
| * @license | ||
| * Copyright 2024 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| export * from '@firebase/firestore'; | ||
|
|
||
| import * as pipelines from '@firebase/firestore/pipelines'; | ||
| export { pipelines }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,6 +59,35 @@ const browserPlugins = [ | |
| terser(util.manglePrivatePropertiesOptions) | ||
| ]; | ||
|
|
||
| // TODO - update the implementation to match all content in the declare module block. | ||
| function declareModuleReplacePlugin() { | ||
| // The regex we created earlier | ||
| const moduleToReplace = | ||
| /declare module '\.\/\S+' \{\s+interface Firestore \{\s+pipeline\(\): PipelineSource<Pipeline>;\s+}\s*}/gm; | ||
|
|
||
| // What to replace it with (an empty string to remove it) | ||
|
||
| const replacement = | ||
| 'interface Firestore {pipeline(): PipelineSource<Pipeline>;}'; | ||
|
|
||
| return { | ||
| name: 'declare-module-replace', | ||
| generateBundle(options, bundle) { | ||
| const outputFileName = 'global_index.d.ts'; | ||
| if (!bundle[outputFileName]) { | ||
| console.warn( | ||
| `[regexReplacePlugin] File not found in bundle: ${outputFileName}` | ||
| ); | ||
| return; | ||
| } | ||
|
|
||
| const chunk = bundle[outputFileName]; | ||
| if (chunk.type === 'chunk') { | ||
| chunk.code = chunk.code.replace(moduleToReplace, replacement); | ||
| } | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| const allBuilds = [ | ||
| // Intermediate Node ESM build without build target reporting | ||
| // this is an intermediate build used to generate the actual esm and cjs builds | ||
|
|
@@ -214,15 +243,17 @@ const allBuilds = [ | |
| } | ||
| }, | ||
| { | ||
| input: 'dist/firestore/src/index.d.ts', | ||
| input: 'dist/firestore/src/global.d.ts', | ||
| output: { | ||
| file: 'dist/firestore/src/global_index.d.ts', | ||
| format: 'es' | ||
| }, | ||
| plugins: [ | ||
| dts({ | ||
| respectExternal: true | ||
| }) | ||
| }), | ||
|
|
||
| declareModuleReplacePlugin() | ||
|
||
| ] | ||
| } | ||
| ]; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -146,7 +146,11 @@ export class FirestoreClient { | |
| * an async I/O to complete). | ||
| */ | ||
| public asyncQueue: AsyncQueue, | ||
| private databaseInfo: DatabaseInfo, | ||
| /** | ||
| * @internal | ||
|
||
| * Exposed for testing | ||
| */ | ||
| public _databaseInfo: DatabaseInfo, | ||
| componentProvider?: { | ||
| _offline: OfflineComponentProvider; | ||
| _online: OnlineComponentProvider; | ||
|
|
@@ -167,7 +171,7 @@ export class FirestoreClient { | |
| get configuration(): ComponentConfiguration { | ||
| return { | ||
| asyncQueue: this.asyncQueue, | ||
| databaseInfo: this.databaseInfo, | ||
| databaseInfo: this._databaseInfo, | ||
| clientId: this.clientId, | ||
| authCredentials: this.authCredentials, | ||
| appCheckCredentials: this.appCheckCredentials, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /** | ||
| * @license | ||
| * Copyright 2025 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| // This file supports a special internal build that includes the entire | ||
| // Firestore classic and pipeline api surface in one bundle. | ||
|
|
||
| import * as pipelines from './api_pipelines'; | ||
| export * from './api'; | ||
| export { pipelines }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All our custom rollup plugins exist in
scripts/build. Can you move this plugin to a new file in that directory?