Skip to content

Commit a7e3720

Browse files
authored
[Firestore] Consolidate Firestore and FirestoreSwift (#11806)
1 parent b962ad6 commit a7e3720

30 files changed

+264
-136
lines changed

FirebaseFirestore.podspec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
5151
'Firestore/core/include/**/*.{cc,mm}',
5252
'Firestore/core/src/**/*.{cc,mm}',
5353
'FirebaseAuth/Interop/*.h',
54+
'Firestore/Swift/Source/**/*.swift',
5455
]
5556

5657
# Internal headers that aren't necessarily globally unique. Most C++ internal
@@ -89,6 +90,8 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
8990

9091
s.dependency 'FirebaseAppCheckInterop', '~> 10.17'
9192
s.dependency 'FirebaseCore', '~> 10.0'
93+
s.dependency 'FirebaseCoreExtension', '~> 10.0'
94+
s.dependency 'FirebaseSharedSwift', '~> 10.0'
9295

9396
abseil_version = '~> 1.20220623.0'
9497
s.dependency 'abseil/algorithm', abseil_version
@@ -111,6 +114,7 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
111114
s.library = 'c++'
112115
s.pod_target_xcconfig = {
113116
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14',
117+
'CLANG_CXX_LIBRARY' => 'libc++',
114118
'GCC_C_LANGUAGE_STANDARD' => 'c99',
115119
'GCC_PREPROCESSOR_DEFINITIONS' =>
116120
"FIRFirestore_VERSION=#{s.version} " +

FirebaseFirestoreSwift.podspec

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,9 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
3131

3232
s.requires_arc = true
3333
s.source_files = [
34-
'Firestore/Swift/Source/**/*.swift',
34+
'FirebaseFirestoreSwift/Sources/FirebaseFirestoreSwift.swift'
3535
]
3636

37-
s.dependency 'FirebaseCore', '~> 10.0'
38-
s.dependency 'FirebaseCoreExtension', '~> 10.0'
39-
s.dependency 'FirebaseFirestore', '~> 10.0'
40-
s.dependency 'FirebaseSharedSwift', '~> 10.0'
37+
s.dependency 'FirebaseFirestore', '~> 10.17'
4138

4239
end
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright 2023 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#warning(
16+
"All of the public API from `FirebaseFirestoreSwift` can now be accessed through the `FirebaseFirestore` module. Therefore, the `FirebaseFirestoreSwift` module is deprecated and will be removed in the future. See https://firebase.google.com/docs/ios/swift-migration for migration instructions."
17+
)
18+
19+
// The `@_exported` is needed to prevent breaking clients that are using
20+
// types prefixed with the `FirebaseFirestoreSwift` namespace.
21+
@_exported import enum FirebaseFirestore.DecodingFailureStrategy
22+
@_exported import struct FirebaseFirestore.DocumentID
23+
@_exported import protocol FirebaseFirestore.DocumentIDWrappable
24+
@_exported import struct FirebaseFirestore.ExplicitNull
25+
@_exported import enum FirebaseFirestore.FirestoreDecodingError
26+
@_exported import enum FirebaseFirestore.FirestoreEncodingError
27+
@_exported import struct FirebaseFirestore.FirestoreQuery
28+
@_exported import enum FirebaseFirestore.QueryPredicate
29+
@_exported import struct FirebaseFirestore.ServerTimestamp
30+
@_exported import protocol FirebaseFirestore.ServerTimestampWrappable

Firestore/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Unreleased
2+
- [feature] The `FirebaseFirestore` module now contains Firebase Firestore's
3+
Swift-only APIs that were previously only available via the
4+
`FirebaseFirestoreSwift` extension SDK. See the
5+
`FirebaseFirestoreSwift` release note from this release for more details.
6+
17
# 10.16.0
28
- [fixed] Fixed an issue where Firestore's binary SwiftPM distribution would
39
not link properly when building a target for testing. This issue affected

Firestore/Swift/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Unreleased
2+
- [deprecated] All of the public API from `FirebaseFirestoreSwift` can now
3+
be accessed through the `FirebaseFirestore` module. Therefore,
4+
`FirebaseFirestoreSwift` has been deprecated, and will be removed in a
5+
future release. See https://firebase.google.com/docs/ios/swift-migration for
6+
migration instructions.
7+
18
# 10.12.0
29
- [added] Added support animations on the `@FirestoreQuery` property wrapper.
310

Firestore/Swift/Source/AsyncAwait/CollectionReference+AsyncAwait.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
import FirebaseFirestore
17+
#if SWIFT_PACKAGE
18+
@_exported import FirebaseFirestoreInternal
19+
#endif // SWIFT_PACKAGE
1820
import Foundation
1921

2022
#if compiler(>=5.5.2) && canImport(_Concurrency)

Firestore/Swift/Source/AsyncAwait/Firestore+AsyncAwait.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
import FirebaseFirestore
17+
#if SWIFT_PACKAGE
18+
@_exported import FirebaseFirestoreInternal
19+
#endif // SWIFT_PACKAGE
1820
import Foundation
1921

2022
#if compiler(>=5.5.2) && canImport(_Concurrency)

Firestore/Swift/Source/Codable/CodablePassThroughTypes.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616

1717
import Foundation
1818
import FirebaseSharedSwift
19-
import FirebaseFirestore
19+
#if SWIFT_PACKAGE
20+
@_exported import FirebaseFirestoreInternal
21+
#endif // SWIFT_PACKAGE
2022

2123
internal struct FirestorePassthroughTypes: StructureCodingPassthroughTypeResolver {
2224
static func isPassthroughType<T>(_ t: T) -> Bool {

Firestore/Swift/Source/Codable/CollectionReference+WriteEncodable.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
*/
1616

1717
import Foundation
18-
import FirebaseFirestore
18+
#if SWIFT_PACKAGE
19+
@_exported import FirebaseFirestoreInternal
20+
#endif // SWIFT_PACKAGE
1921

2022
public extension CollectionReference {
2123
/// Encodes an instance of `Encodable` and adds a new document to this collection

Firestore/Swift/Source/Codable/DocumentID.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
import FirebaseFirestore
17+
#if SWIFT_PACKAGE
18+
@_exported import FirebaseFirestoreInternal
19+
#endif // SWIFT_PACKAGE
1820
import FirebaseSharedSwift
1921
@_implementationOnly import FirebaseCoreExtension
2022

0 commit comments

Comments
 (0)