Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 4 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ on:
types: [published]
workflow_dispatch:

env:
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app

jobs:
publish-docs:
name: Publish Documentation
runs-on: macos-12
env:
DEVELOPER_DIR: /Applications/Xcode_14.2.app
runs-on: macos-13
steps:
- uses: actions/checkout@v2
- name: Build docs
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ on:
workflow_dispatch:

env:
DEVELOPER_DIR: /Applications/Xcode_14.2.app
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app

jobs:
test:
name: Test
runs-on: macos-12
runs-on: macos-13
strategy:
matrix:
platform:
Expand All @@ -36,7 +36,7 @@ jobs:

validation:
name: Validation
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v2
- name: Show environments
Expand Down
7 changes: 4 additions & 3 deletions Examples/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -187,7 +187,8 @@
6B590BF25178DC7D824D09CE /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1200;
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1430;
TargetAttributes = {
0B9FD0BB6D9928064433FF9B = {
ProvisioningStyle = Manual;
Expand All @@ -204,7 +205,7 @@
};
};
buildConfigurationList = B3FD05C59F197F398A0B04AB /* Build configuration list for PBXProject "App" */;
compatibilityVersion = "Xcode 11.0";
compatibilityVersion = "Xcode 14.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Expand Down
2 changes: 1 addition & 1 deletion Examples/App.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
LastUpgradeVersion = "1430"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ docs:
$(PACKAGE) \
--allow-writing-to-directory docs \
generate-documentation \
--include-extended-types \
--experimental-skip-synthesized-symbols \
--product Atoms \
--disable-indexing \
--transform-for-static-hosting \
Expand All @@ -30,4 +32,6 @@ docs-preview:
$(PACKAGE) \
--disable-sandbox \
preview-documentation \
--include-extended-types \
--experimental-skip-synthesized-symbols \
--product Atoms
16 changes: 8 additions & 8 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.7
// swift-tools-version:5.8

import Foundation
import PackageDescription
Expand Down Expand Up @@ -26,8 +26,8 @@ let package = Package(

if ProcessInfo.processInfo.environment["SWIFTUI_ATOM_PROPERTIES_DEVELOPMENT"] != nil {
package.dependencies.append(contentsOf: [
.package(url: "https://github.com/apple/swift-docc-plugin", exact: "1.2.0"),
.package(url: "https://github.com/apple/swift-format.git", exact: "508.0.0"),
.package(url: "https://github.com/yonaskolb/XcodeGen.git", exact: "2.35.0"),
.package(url: "https://github.com/apple/swift-docc-plugin", exact: "1.3.0"),
.package(url: "https://github.com/apple/swift-format.git", exact: "508.0.1"),
.package(url: "https://github.com/yonaskolb/XcodeGen.git", exact: "2.37.0"),
])
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ Open `Examples/App.xcodeproj` and play around with it!

| |Minimum Version|
|------:|--------------:|
|Swift |5.7 |
|Xcode |14.2 |
|Swift |5.8.1 |
|Xcode |14.3.1 |
|iOS |14.0 |
|macOS |11.0 |
|tvOS |14.0 |
Expand Down
4 changes: 3 additions & 1 deletion Sources/Atoms/Core/Loader/AsyncSequenceAtomLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public struct AsyncSequenceAtomLoader<Node: AsyncSequenceAtom>: RefreshableAtomL

do {
for try await element in sequence {
phase = .success(element)
if !Task.isCancelled {
phase = .success(element)
}
}
}
catch {
Expand Down
4 changes: 3 additions & 1 deletion Sources/Atoms/Core/Loader/PublisherAtomLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public struct PublisherAtomLoader<Node: PublisherAtom>: RefreshableAtomLoader {
var phase = Value.suspending

for await result in results {
phase = AsyncPhase(result)
if !Task.isCancelled {
phase = AsyncPhase(result)
}
}

return phase
Expand Down
4 changes: 3 additions & 1 deletion Sources/Atoms/Core/StoreContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@ private extension StoreContext {
// have not yet been updated and are still old when dependent atoms read it.
// As a workaround, the update is executed in the next run loop
// so that the downstream atoms can receive the object that's already updated.
RunLoop.current.perform(notifyUpdate)
RunLoop.current.perform {
notifyUpdate()
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/AtomsTests/Atom/AsyncSequenceAtomTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ final class AsyncSequenceAtomTests: XCTestCase {

let phase = await refreshTask.value

XCTAssertEqual(phase.value, 1)
XCTAssertTrue(phase.isSuspending)
XCTAssertEqual(updateCount, 0)
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/AtomsTests/Atom/PublisherAtomTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ final class PublisherAtomTests: XCTestCase {

let phase = await refreshTask.value

XCTAssertEqual(phase, .success(1))
XCTAssertEqual(phase, .suspending)
XCTAssertEqual(updateCount, 0)
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/swift-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -eu

function swift_build() {
SWIFTUI_ATOM_PROPERTIES_DEVELOPMENT=1 swift build -c release --only-use-versions-from-resolved-file $@
SWIFTUI_ATOM_PROPERTIES_DEVELOPMENT=1 swift build -c release $@
}

PACKAGE=$1
Expand All @@ -29,7 +29,7 @@ if [[ ! -f $BIN || $checksum != $(cat $CHECKSUM_FILE 2>/dev/null) ]]; then

if [[ -e ${SWIFT_PACKAGE_RESOURCES:-} ]]; then
echo "Copying $SWIFT_PACKAGE_RESOURCES..."
cp -R $SWIFT_PACKAGE_RESOURCES $BIN_DIR
cp -Rf $SWIFT_PACKAGE_RESOURCES $BIN_DIR
fi

echo "$checksum" >"$CHECKSUM_FILE"
Expand Down
6 changes: 3 additions & 3 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ pushd "$(cd $(dirname $0)/.. && pwd)" &>/dev/null

case $PLATFORM in
ios)
platform="iOS Simulator,name=iPhone 13 Pro"
platform="iOS Simulator,name=iPhone 14 Pro"
;;
macos)
platform="macOS"
;;
tvos)
platform="tvOS Simulator,name=Apple TV 4K (at 1080p) (2nd generation)"
platform="tvOS Simulator,name=Apple TV 4K (3rd generation)"
;;
watchos)
platform="watchOS Simulator,name=Apple Watch Series 7 (45mm)"
platform="watchOS Simulator,name=Apple Watch Ultra (49mm)"
;;
esac

Expand Down