File tree Expand file tree Collapse file tree 17 files changed +196
-75
lines changed Expand file tree Collapse file tree 17 files changed +196
-75
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @firebase/firestore ' : patch
3+ ' firebase ' : patch
4+ ---
5+
6+ Internal refactor of platform-specific logic to create TextEncoder and TextDecoder objects.
Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ import { DocumentKey } from '../model/document_key';
3636import { Mutation } from '../model/mutation' ;
3737import { ObjectValue } from '../model/object_value' ;
3838import { toByteStreamReader } from '../platform/byte_stream_reader' ;
39- import { newSerializer , newTextEncoder } from '../platform/serializer' ;
39+ import { newSerializer } from '../platform/serializer' ;
40+ import { newTextEncoder } from '../platform/text_serializer' ;
4041import { Datastore , invokeRunAggregationQueryRpc } from '../remote/datastore' ;
4142import {
4243 canUseNetwork ,
Original file line number Diff line number Diff line change @@ -22,17 +22,3 @@ import { JsonProtoSerializer } from '../../remote/serializer';
2222export function newSerializer ( databaseId : DatabaseId ) : JsonProtoSerializer {
2323 return new JsonProtoSerializer ( databaseId , /* useProto3Json= */ true ) ;
2424}
25-
26- /**
27- * An instance of the Platform's 'TextEncoder' implementation.
28- */
29- export function newTextEncoder ( ) : TextEncoder {
30- return new TextEncoder ( ) ;
31- }
32-
33- /**
34- * An instance of the Platform's 'TextDecoder' implementation.
35- */
36- export function newTextDecoder ( ) : TextDecoder {
37- return new TextDecoder ( 'utf-8' ) ;
38- }
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright 2023 Google LLC
4+ *
5+ * Licensed under the Apache License, Version 2.0 (the "License");
6+ * you may not use this file except in compliance with the License.
7+ * You may obtain a copy of the License at
8+ *
9+ * http://www.apache.org/licenses/LICENSE-2.0
10+ *
11+ * Unless required by applicable law or agreed to in writing, software
12+ * distributed under the License is distributed on an "AS IS" BASIS,
13+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ * See the License for the specific language governing permissions and
15+ * limitations under the License.
16+ */
17+
18+ /**
19+ * An instance of the Platform's 'TextEncoder' implementation.
20+ */
21+ export function newTextEncoder ( ) : TextEncoder {
22+ return new TextEncoder ( ) ;
23+ }
24+
25+ /**
26+ * An instance of the Platform's 'TextDecoder' implementation.
27+ */
28+ export function newTextDecoder ( ) : TextDecoder {
29+ return new TextDecoder ( 'utf-8' ) ;
30+ }
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright 2023 Google LLC
4+ *
5+ * Licensed under the Apache License, Version 2.0 (the "License");
6+ * you may not use this file except in compliance with the License.
7+ * You may obtain a copy of the License at
8+ *
9+ * http://www.apache.org/licenses/LICENSE-2.0
10+ *
11+ * Unless required by applicable law or agreed to in writing, software
12+ * distributed under the License is distributed on an "AS IS" BASIS,
13+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ * See the License for the specific language governing permissions and
15+ * limitations under the License.
16+ */
17+
18+ export * from '../browser/text_serializer' ;
Original file line number Diff line number Diff line change 1616 */
1717
1818/** Return the Platform-specific serializer monitor. */
19- import { TextDecoder , TextEncoder } from 'util' ;
20-
2119import { DatabaseId } from '../../core/database_info' ;
2220import { JsonProtoSerializer } from '../../remote/serializer' ;
2321
2422export function newSerializer ( databaseId : DatabaseId ) : JsonProtoSerializer {
2523 return new JsonProtoSerializer ( databaseId , /* useProto3Json= */ false ) ;
2624}
27-
28- /**
29- * An instance of the Platform's 'TextEncoder' implementation.
30- */
31- export function newTextEncoder ( ) : TextEncoder {
32- return new TextEncoder ( ) ;
33- }
34-
35- /**
36- * An instance of the Platform's 'TextDecoder' implementation.
37- */
38- export function newTextDecoder ( ) : TextDecoder {
39- return new TextDecoder ( 'utf-8' ) ;
40- }
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright 2023 Google LLC
4+ *
5+ * Licensed under the Apache License, Version 2.0 (the "License");
6+ * you may not use this file except in compliance with the License.
7+ * You may obtain a copy of the License at
8+ *
9+ * http://www.apache.org/licenses/LICENSE-2.0
10+ *
11+ * Unless required by applicable law or agreed to in writing, software
12+ * distributed under the License is distributed on an "AS IS" BASIS,
13+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ * See the License for the specific language governing permissions and
15+ * limitations under the License.
16+ */
17+
18+ import { TextDecoder , TextEncoder } from 'util' ;
19+
20+ /**
21+ * An instance of the Platform's 'TextEncoder' implementation.
22+ */
23+ export function newTextEncoder ( ) : TextEncoder {
24+ return new TextEncoder ( ) ;
25+ }
26+
27+ /**
28+ * An instance of the Platform's 'TextDecoder' implementation.
29+ */
30+ export function newTextDecoder ( ) : TextDecoder {
31+ return new TextDecoder ( 'utf-8' ) ;
32+ }
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright 2023 Google LLC
4+ *
5+ * Licensed under the Apache License, Version 2.0 (the "License");
6+ * you may not use this file except in compliance with the License.
7+ * You may obtain a copy of the License at
8+ *
9+ * http://www.apache.org/licenses/LICENSE-2.0
10+ *
11+ * Unless required by applicable law or agreed to in writing, software
12+ * distributed under the License is distributed on an "AS IS" BASIS,
13+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ * See the License for the specific language governing permissions and
15+ * limitations under the License.
16+ */
17+
18+ export * from '../browser_lite/text_serializer' ;
Original file line number Diff line number Diff line change 1515 * limitations under the License.
1616 */
1717
18- export {
19- newSerializer ,
20- newTextEncoder ,
21- newTextDecoder
22- } from '../browser/serializer' ;
18+ export { newSerializer } from '../browser/serializer' ;
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright 2023 Google LLC
4+ *
5+ * Licensed under the Apache License, Version 2.0 (the "License");
6+ * you may not use this file except in compliance with the License.
7+ * You may obtain a copy of the License at
8+ *
9+ * http://www.apache.org/licenses/LICENSE-2.0
10+ *
11+ * Unless required by applicable law or agreed to in writing, software
12+ * distributed under the License is distributed on an "AS IS" BASIS,
13+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ * See the License for the specific language governing permissions and
15+ * limitations under the License.
16+ */
17+
18+ export { newTextEncoder , newTextDecoder } from '../browser/text_serializer' ;
You can’t perform that action at this time.
0 commit comments