Skip to content
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

Introduce PerceptionCore module #105

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,35 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-macro-testing",
"state" : {
"revision" : "a35257b7e9ce44e92636447003a8eeefb77b145c",
"version" : "0.5.1"
"revision" : "20c1a8f3b624fb5d1503eadcaa84743050c350f4",
"version" : "0.5.2"
}
},
{
"identity" : "swift-snapshot-testing",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-snapshot-testing",
"state" : {
"revision" : "c097f955b4e724690f0fc8ffb7a6d4b881c9c4e3",
"version" : "1.17.2"
"revision" : "42a086182681cf661f5c47c9b7dc3931de18c6d7",
"version" : "1.17.6"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/swiftlang/swift-syntax",
"state" : {
"revision" : "4c6cc0a3b9e8f14b3ae2307c5ccae4de6167ac2c",
"version" : "600.0.0-prerelease-2024-06-12"
"revision" : "0687f71944021d616d34d922343dcef086855920",
"version" : "600.0.1"
}
},
{
"identity" : "xctest-dynamic-overlay",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
"state" : {
"revision" : "357ca1e5dd31f613a1d43320870ebc219386a495",
"version" : "1.2.2"
"revision" : "770f990d3e4eececb57ac04a6076e22f8c97daeb",
"version" : "1.4.2"
}
}
],
Expand Down
10 changes: 9 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ let package = Package(
.watchOS(.v6),
],
products: [
.library(name: "Perception", targets: ["Perception"])
.library(name: "Perception", targets: ["Perception"]),
.library(name: "PerceptionCore", targets: ["PerceptionCore"]),
],
dependencies: [
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.1.0"),
Expand All @@ -22,6 +23,13 @@ let package = Package(
targets: [
.target(
name: "Perception",
dependencies: [
"PerceptionCore",
"PerceptionMacros",
]
),
.target(
name: "PerceptionCore",
dependencies: [
"PerceptionMacros",
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
Expand Down
1 change: 1 addition & 0 deletions Sources/Perception/Exports.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@_exported import PerceptionCore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public struct PerceptionRegistrar: Sendable {
/// ``PerceptionRegistrar`` when using the
/// ``Perception/Perceptible()`` macro to indicate observably
/// of a type.
public init(isPerceptionCheckingEnabled: Bool = Perception.isPerceptionCheckingEnabled) {
public init(isPerceptionCheckingEnabled: Bool = PerceptionCore.isPerceptionCheckingEnabled) {
if #available(iOS 17, macOS 14, tvOS 17, watchOS 10, *), !isObservationBeta {
#if canImport(Observation)
self._rawValue = AnySendable(ObservationRegistrar())
Expand Down Expand Up @@ -210,7 +210,7 @@ extension PerceptionRegistrar: Hashable {
column: UInt
) {
if self.isPerceptionCheckingEnabled,
Perception.isPerceptionCheckingEnabled,
PerceptionCore.isPerceptionCheckingEnabled,
!_PerceptionLocals.isInPerceptionTracking,
!_PerceptionLocals.skipPerceptionChecking,
self.isInSwiftUIBody(file: filePath, line: line)
Expand Down