From 23637714bf49ea64166fc819294378107882a59d Mon Sep 17 00:00:00 2001 From: Robert MacEachern Date: Tue, 29 Oct 2024 14:46:29 -0500 Subject: [PATCH 1/6] Bump CI Xcode to 15.4 (from 15.1) --- .github/workflows/env.properties | 2 +- CHANGELOG.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/env.properties b/.github/workflows/env.properties index d1fa2bd69..405177060 100644 --- a/.github/workflows/env.properties +++ b/.github/workflows/env.properties @@ -1 +1 @@ -xcode_version=15.1 +xcode_version=15.4.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index a2f8d843e..6591cd3ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Internal +- Bump CI Xcode version to 15.4. + # Past Releases ## [4.3.0] - 2024-09-18 From de144c86eab81c89c0264aae85dee347298b3ab5 Mon Sep 17 00:00:00 2001 From: Robert MacEachern Date: Tue, 29 Oct 2024 14:54:08 -0500 Subject: [PATCH 2/6] Bump Github jobs to use macos-14 --- .github/workflows/docs.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/tests.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 25a910e9c..4a11b8022 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,7 +7,7 @@ on: jobs: build: name: Generate docs with jazzy and publish to Github pages - runs-on: macos-13-xlarge + runs-on: macos-14-xlarge steps: - name: Checkout diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 89ab28de3..201ff1434 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,7 +9,7 @@ on: jobs: lint: name: Lint Swift code with SwiftFormat - runs-on: macos-13-xlarge + runs-on: macos-14-xlarge steps: - name: Checkout diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8a4c520a3..2ac73dd31 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -10,7 +10,7 @@ jobs: spm: name: "iOS ${{ matrix.sdk }}" - runs-on: macos-13-xlarge + runs-on: macos-14-xlarge strategy: fail-fast: false # Don’t fail-fast so that we get all snapshot test changes @@ -66,7 +66,7 @@ jobs: cocoapods: name: "CocoaPods" - runs-on: macos-13-xlarge + runs-on: macos-14-xlarge steps: - uses: actions/checkout@v4 From 50e97b263cc612a0b7a243c4f74b5d4174417a0e Mon Sep 17 00:00:00 2001 From: Robert MacEachern Date: Tue, 29 Oct 2024 09:41:04 -0500 Subject: [PATCH 3/6] Annotate `updateViewHierarchyIfNeeded` and `update(node:context:)` with @MainActor and add `preconditionIsolated` runtime check --- BlueprintUI/Sources/BlueprintView/BlueprintView.swift | 5 +++++ CHANGELOG.md | 2 ++ 2 files changed, 7 insertions(+) diff --git a/BlueprintUI/Sources/BlueprintView/BlueprintView.swift b/BlueprintUI/Sources/BlueprintView/BlueprintView.swift index 3b978ed03..a716d4ccd 100644 --- a/BlueprintUI/Sources/BlueprintView/BlueprintView.swift +++ b/BlueprintUI/Sources/BlueprintView/BlueprintView.swift @@ -364,7 +364,10 @@ public final class BlueprintView: UIView { setNeedsLayout() } + @MainActor private func updateViewHierarchyIfNeeded() { + MainActor.preconditionIsolated("updateViewHierarchyIfNeeded must only execute on the main actor.") + guard needsViewHierarchyUpdate || bounds != lastViewHierarchyUpdateBounds else { return } precondition( @@ -612,7 +615,9 @@ extension BlueprintView { node.viewDescription.viewType == type(of: view) } + @MainActor fileprivate func update(node: NativeViewNode, context: UpdateContext) -> UpdateResult { + MainActor.preconditionIsolated("BlueprintView.NativeViewController.update(node:context:) must only execute on the main actor.") assert(node.viewDescription.viewType == type(of: view)) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6591cd3ce..6dc6e5ce6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- `BlueprintView` has added preconditions to some methods to ensure they are only invoked on the main queue. + ### Removed ### Changed From 63abb212a7b691bd3e0a51d4d7cdd4caa5bb43c6 Mon Sep 17 00:00:00 2001 From: Alex Odawa Date: Tue, 29 Oct 2024 22:25:09 +0100 Subject: [PATCH 4/6] Renamed accessibility(...) to deprecated_accessibility(...) (#516) Opening up the namespace for a more proper `accessibility(value:label:hint:identifier:traits:)` --- BlueprintUICommonControls/Sources/AccessibilityElement.swift | 2 +- CHANGELOG.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/BlueprintUICommonControls/Sources/AccessibilityElement.swift b/BlueprintUICommonControls/Sources/AccessibilityElement.swift index 0decb11f1..014cec888 100644 --- a/BlueprintUICommonControls/Sources/AccessibilityElement.swift +++ b/BlueprintUICommonControls/Sources/AccessibilityElement.swift @@ -204,7 +204,7 @@ extension Element { deprecated, renamed: "accessibilityElement(label:value:traits:hint:identifier:accessibilityFrameSize:)" ) - public func accessibility( + public func deprecated_accessibility( label: String? = nil, value: String? = nil, hint: String? = nil, diff --git a/CHANGELOG.md b/CHANGELOG.md index a2f8d843e..2f4e8116e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed ### Changed +Renamed deprecated function `accessibility(label:value:traits:hint:identifier:accessibilityFrameSize:)` to `deprecated_accessibility(label:value:traits:hint:identifier:accessibilityFrameSize:)`. ### Deprecated From d2ded60331e099980432a5fb45b92839342498a5 Mon Sep 17 00:00:00 2001 From: Robert MacEachern Date: Wed, 30 Oct 2024 09:41:27 -0500 Subject: [PATCH 5/6] Add precondition to `setNeedsViewHierarchyUpdate`. Expanded precondition message to encourage self-diagnosis. --- .../Sources/BlueprintView/BlueprintView.swift | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/BlueprintUI/Sources/BlueprintView/BlueprintView.swift b/BlueprintUI/Sources/BlueprintView/BlueprintView.swift index a716d4ccd..94ec5cccf 100644 --- a/BlueprintUI/Sources/BlueprintView/BlueprintView.swift +++ b/BlueprintUI/Sources/BlueprintView/BlueprintView.swift @@ -350,7 +350,16 @@ public final class BlueprintView: UIView { /// Clears any sizing caches, invalidates the `intrinsicContentSize` of the /// view, and marks the view as needing a layout. + @MainActor private func setNeedsViewHierarchyUpdate() { + MainActor.preconditionIsolated( + """ + setNeedsViewHierarchyUpdate() must only execute on the main actor. + + Examine your stack trace to determine what caused this to be called + off of the main actor. + """ + ) invalidateIntrinsicContentSize() sizesThatFit.removeAll() @@ -366,7 +375,14 @@ public final class BlueprintView: UIView { @MainActor private func updateViewHierarchyIfNeeded() { - MainActor.preconditionIsolated("updateViewHierarchyIfNeeded must only execute on the main actor.") + MainActor.preconditionIsolated( + """ + updateViewHierarchyIfNeeded() must only execute on the main actor. + + Examine your stack trace to determine what caused this to be called + off of the main actor. + """ + ) guard needsViewHierarchyUpdate || bounds != lastViewHierarchyUpdateBounds else { return } @@ -617,7 +633,15 @@ extension BlueprintView { @MainActor fileprivate func update(node: NativeViewNode, context: UpdateContext) -> UpdateResult { - MainActor.preconditionIsolated("BlueprintView.NativeViewController.update(node:context:) must only execute on the main actor.") + MainActor.preconditionIsolated( + """ + BlueprintView.NativeViewController.update(node:context:) must + only execute on the main actor. + + Examine your stack trace to determine what caused this to be + called off of the main actor. + """ + ) assert(node.viewDescription.viewType == type(of: view)) From 73df5ff72f8e6c24005cda8332d154ebbf8fe0ae Mon Sep 17 00:00:00 2001 From: Robert MacEachern Date: Wed, 30 Oct 2024 14:56:44 -0500 Subject: [PATCH 6/6] Bumping versions to 5.0.0. --- CHANGELOG.md | 16 ++++++++++++---- SampleApp/Podfile.lock | 12 ++++++------ version.rb | 2 +- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0aab9741a..6325d7427 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,12 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- `BlueprintView` has added preconditions to some methods to ensure they are only invoked on the main queue. - ### Removed ### Changed -Renamed deprecated function `accessibility(label:value:traits:hint:identifier:accessibilityFrameSize:)` to `deprecated_accessibility(label:value:traits:hint:identifier:accessibilityFrameSize:)`. ### Deprecated @@ -32,6 +29,16 @@ Renamed deprecated function `accessibility(label:value:traits:hint:identifier:ac # Past Releases +## [5.0.0] - 2024-10-30 + +### Added + +- `BlueprintView` has added preconditions to some methods to ensure they are only invoked on the main queue. + +### Changed + +- Renamed deprecated function `accessibility(label:value:traits:hint:identifier:accessibilityFrameSize:)` to `deprecated_accessibility(label:value:traits:hint:identifier:accessibilityFrameSize:)`. + ## [4.3.0] - 2024-09-18 ### Added @@ -1118,7 +1125,8 @@ searchField - First stable release. -[main]: https://github.com/square/Blueprint/compare/4.3.0...HEAD +[main]: https://github.com/square/Blueprint/compare/5.0.0...HEAD +[5.0.0]: https://github.com/square/Blueprint/compare/4.3.0...5.0.0 [4.3.0]: https://github.com/square/Blueprint/compare/4.2.1...4.3.0 [4.2.1]: https://github.com/square/Blueprint/compare/4.2.0...4.2.1 [4.2.0]: https://github.com/square/Blueprint/compare/4.1.2...4.2.0 diff --git a/SampleApp/Podfile.lock b/SampleApp/Podfile.lock index b953e9405..b38bd5ba1 100644 --- a/SampleApp/Podfile.lock +++ b/SampleApp/Podfile.lock @@ -1,8 +1,8 @@ PODS: - - BlueprintUI (4.3.0) - - BlueprintUI/Tests (4.3.0) - - BlueprintUICommonControls (4.3.0): - - BlueprintUI (= 4.3.0) + - BlueprintUI (5.0.0) + - BlueprintUI/Tests (5.0.0) + - BlueprintUICommonControls (5.0.0): + - BlueprintUI (= 5.0.0) DEPENDENCIES: - BlueprintUI (from `../BlueprintUI.podspec`) @@ -16,8 +16,8 @@ EXTERNAL SOURCES: :path: "../BlueprintUICommonControls.podspec" SPEC CHECKSUMS: - BlueprintUI: be852bd1c895f5405af2c75a6aa8bef0dacf41a8 - BlueprintUICommonControls: 41b66f55f4bbc8454e0e6fa01dbbabdd499accba + BlueprintUI: 0e2d2944bca6c0d6d96df711a43bce01154bb7ef + BlueprintUICommonControls: 8f400ee3ecf2bc58bd21cce29caba9f7c83d22b8 PODFILE CHECKSUM: 1cffac4623851f31dc42270ba99701e3825e6d67 diff --git a/version.rb b/version.rb index 75edce2cd..2b3e90d67 100644 --- a/version.rb +++ b/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -BLUEPRINT_VERSION ||= '4.3.0' +BLUEPRINT_VERSION ||= '5.0.0' SWIFT_VERSION ||= File.read(File.join(__dir__, '.swift-version'))