Skip to content

Commit 30c9719

Browse files
github-actions[bot]Firefox Sync Engineering
andauthored
Auto update with latest AS Release v93.0.3 (#51)
* Updates Package.swift with v93.0.3 release * Version 93.0.3 Co-authored-by: Firefox Sync Engineering <[email protected]>
1 parent be7deba commit 30c9719

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// swift-tools-version:5.4
22
import PackageDescription
33

4-
let checksum = "d685d7413f1421f40e708c66bb1a8d730f76788799c14fd56252719ec5578788"
5-
let version = "v93.0.2"
4+
let checksum = "4b3203084c522ca1bf9bd56bd91cc7879035718d31d1bbc20e3efb5a9a51c687"
5+
let version = "v93.0.3"
66
let url = "https://github.com/mozilla/application-services/releases/download/\(version)/MozillaRustComponents.xcframework.zip"
77

88
let package = Package(

swift-source/Generated/Metrics/Metrics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extension GleanMetrics {
2222
// Intentionally left private, no external user can instantiate a new global object.
2323
}
2424

25-
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2022, month: 4, day: 25, hour: 18, minute: 17, second: 22))
25+
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2022, month: 4, day: 27, hour: 21, minute: 18, second: 28))
2626
}
2727

2828
enum NimbusEvents {

swift-source/Nimbus/FeatureHolder.swift

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,28 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5+
typealias GetSdk = () -> FeaturesInterface?
6+
57
public class FeatureHolder<T> {
6-
private let apiFn: () -> FeaturesInterface?
8+
private let getSdk: GetSdk
79
private let featureId: String
810
private let create: (Variables) -> T
9-
private var exposureRecorder: (() -> Void)?
1011

11-
public init(_ apiFn: @escaping () -> FeaturesInterface?,
12-
_ featureId: String,
13-
_ create: @escaping (Variables) -> T)
12+
public init(_ getSdk: @escaping () -> FeaturesInterface?,
13+
featureId: String,
14+
with create: @escaping (Variables) -> T)
1415
{
15-
self.apiFn = apiFn
16+
self.getSdk = getSdk
1617
self.featureId = featureId
1718
self.create = create
1819
}
1920

2021
public func value() -> T {
21-
let api = apiFn()
22-
let feature = create(api?.getVariables(featureId: featureId, sendExposureEvent: false) ?? NilVariables.instance)
23-
if let api = api {
24-
weak var weakApi = api
25-
exposureRecorder = { () in
26-
weakApi?.recordExposureEvent(featureId: self.featureId)
27-
}
28-
}
29-
return feature
22+
let variables = getSdk()?.getVariables(featureId: featureId, sendExposureEvent: false) ?? NilVariables.instance
23+
return create(variables)
3024
}
3125

3226
public func recordExposure() {
33-
exposureRecorder?()
27+
getSdk()?.recordExposureEvent(featureId: featureId)
3428
}
3529
}

0 commit comments

Comments
 (0)