Skip to content

Commit

Permalink
Fix a bunch of DocC references. (#3287)
Browse files Browse the repository at this point in the history
* Fix a bunch of DocC references.

* wip

* doc fix

* issue message fix

* swift-navigation 2.0.5
  • Loading branch information
mbrandonw committed Aug 15, 2024
1 parent 833792e commit 3a02c5e
Show file tree
Hide file tree
Showing 72 changed files with 856 additions and 848 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-navigation",
"state" : {
"revision" : "47cfd149ed01223d14fc8e3f52ae27d3a35fe036",
"version" : "2.0.3"
"revision" : "b8dced6524996b3dc5569346697ddcb1bc4307aa",
"version" : "2.0.4"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-navigation",
"state" : {
"revision" : "47cfd149ed01223d14fc8e3f52ae27d3a35fe036",
"version" : "2.0.3"
"revision" : "b8dced6524996b3dc5569346697ddcb1bc4307aa",
"version" : "2.0.4"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let package = Package(
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.3.5"),
.package(url: "https://github.com/pointfreeco/swift-identified-collections", from: "1.1.0"),
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.2.0"),
.package(url: "https://github.com/pointfreeco/swift-navigation", from: "2.0.3"),
.package(url: "https://github.com/pointfreeco/swift-navigation", from: "2.0.5"),
.package(url: "https://github.com/pointfreeco/swift-perception", from: "1.3.4"),
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.2.2"),
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0"),
Expand Down
4 changes: 2 additions & 2 deletions Sources/ComposableArchitecture/CaseReducer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public protocol CaseReducerState {
}

extension Reducer {
/// A special overload of ``Reducer/ifLet(_:action:destination:fileID:line:)-4k9by`` for enum
/// A special overload of ``Reducer/ifLet(_:action:destination:fileID:filePath:line:column:)-4ub6q`` for enum
/// reducers.
public func ifLet<ChildState: CaseReducerState, ChildAction>(
_ state: WritableKeyPath<State, PresentationState<ChildState>>,
Expand All @@ -38,7 +38,7 @@ extension Reducer {
}
}

/// A special overload of ``Reducer/forEach(_:action:destination:fileID:line:)-582rd`` for enum
/// A special overload of ``Reducer/forEach(_:action:destination:fileID:filePath:line:column:)-9svqb`` for enum
/// reducers.
public func forEach<DestinationState: CaseReducerState, DestinationAction>(
_ state: WritableKeyPath<State, StackState<DestinationState>>,
Expand Down
4 changes: 2 additions & 2 deletions Sources/ComposableArchitecture/Dependencies/Dismiss.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ extension DependencyValues {
/// ```
///
/// This operation works by finding the nearest parent feature that was presented using either the
/// ``Reducer/ifLet(_:action:destination:fileID:line:)-4k9by`` or the
/// ``Reducer/forEach(_:action:destination:fileID:line:)-582rd`` operator, and then dismisses _that_
/// ``Reducer/ifLet(_:action:destination:fileID:filePath:line:column:)-4ub6q`` or the
/// ``Reducer/forEach(_:action:destination:fileID:filePath:line:column:)-9svqb`` operator, and then dismisses _that_
/// feature. It performs the dismissal by either sending the ``PresentationAction/dismiss`` in the
/// case of `ifLet` or sending ``StackAction/popFrom(id:)`` in the case of `forEach`.
///
Expand Down
4 changes: 2 additions & 2 deletions Sources/ComposableArchitecture/Dependencies/IsPresented.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ extension DependencyValues {
/// feature.
///
/// This value is set to true on reducers that are run from within
/// ``Reducer/ifLet(_:action:destination:fileID:line:)-4k9by`` and
/// ``Reducer/forEach(_:action:destination:fileID:line:)-582rd``.
/// ``Reducer/ifLet(_:action:destination:fileID:filePath:line:column:)-4ub6q`` and
/// ``Reducer/forEach(_:action:destination:fileID:filePath:line:column:)-9svqb``.
///
/// See ``DismissEffect`` for more information on how child features can easily dismiss themselves
/// without communicating to the parent.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ will be instantly observed by all features holding onto it.

Further, there are persistence strategies one can employ in `@Shared`. For example, if you want any
changes of `signUpData` to be automatically persisted to the file system you can use the
``PersistenceReaderKey/fileStorage(_:)`` and specify a URL:
``PersistenceReaderKey/fileStorage(_:decoder:encoder:)`` and specify a URL:

```swift
@ObservableState
Expand All @@ -59,7 +59,7 @@ struct State {
}
```

Similar to ``PersistenceReaderKey/fileStorage(_:)``, upon launch of the application the initial
Similar to ``PersistenceReaderKey/fileStorage(_:decoder:encoder:)``, upon launch of the application the initial
value of `isOn` will be populated from user defaults, and any change to `isOn` will be automatically
persisted to user defaults. Further, if the user defaults value changes, all instances of `isOn`
in the application will automatically update.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ on these tools):
@Reducer
struct AppFeature {
struct State {
var path: StackState<
var path = StackState<Path.State>()
// ...
}

Expand All @@ -91,8 +91,7 @@ stack state:
class AppController: NavigationStackController {
private var store: StoreOf<AppFeature>!

@MainActor
init(store: StoreOf<AppFeature>) {
convenience init(store: StoreOf<AppFeature>) {
@UIBindable var store = store

self.init(path: $store.scope(state: \.path, action: \.path)) {
Expand All @@ -107,6 +106,7 @@ class AppController: NavigationStackController {
EditViewController(store: store)
}
}

self.model = model
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ You can also technically drop the ``Reducer`` conformance:
```

However, there are some known issues in Xcode that cause autocomplete and type inference to break.
See the documentation of <doc:Reducers#Gotchas> for more gotchas on using the `@Reducer` macro.
See the documentation of <doc:Reducer#Gotchas> for more gotchas on using the `@Reducer` macro.


### Using case key paths
Expand Down Expand Up @@ -278,8 +278,9 @@ enum Action {
}
```

And in the reducer, instead of invoking ``Reducer/forEach(_:action:element:fileID:line:)-92aox``
with a case path using the `/` prefix operator:
And in the reducer, instead of invoking
``Reducer/forEach(_:action:element:fileID:filePath:line:column:)-3dw7i`` with a case path using the
`/` prefix operator:

```swift
Reduce { state, action in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Migrating to 1.6

Update your code to make use of the new ``TestStore/receive(_:_:timeout:assert:file:line:)-dkei``
method when you need to assert on the payload inside an action received.
Update your code to make use of the new
``TestStore/receive(_:_:timeout:assert:fileID:file:line:column:)-9jd7x`` method when you need to
assert on the payload inside an action received.

## Overview

Expand All @@ -16,7 +17,8 @@ In version 1.4 of the library we provided a new assertion method on ``TestStore`
asserting on actions received without asserting on the payload in the action (see
<doc:MigratingTo1.4#Receiving-test-store-actions> for more information). However, sometimes it is
important to assert on the payload, especially when testing delegate actions from child features,
and so that is why 1.6 introduces ``TestStore/receive(_:_:timeout:assert:file:line:)-dkei``.
and so that is why 1.6 introduces
``TestStore/receive(_:_:timeout:assert:fileID:file:line:column:)-9jd7x``.

If you have code like the following for asserting that an action features sends a delegate action
with a specific payload:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ IfLetStore(store: store.scope(state: \.child, action: \.child)) { childStore in
}
```

This can now be updated to use plain `if let` syntax with ``Store/scope(state:action:)-36e72``:
This can now be updated to use plain `if let` syntax with ``Store/scope(state:action:)-90255``:

```swift
if let childStore = store.scope(state: \.child, action: \.child) {
Expand Down Expand Up @@ -212,7 +212,7 @@ ForEachStore(
```

This can now be updated to use the vanilla `ForEach` view in SwiftUI, along with
``Store/scope(state:action:)-1nelp``, identified by the state of each row:
``Store/scope(state:action:)-90255``, identified by the state of each row:

```swift
ForEach(
Expand Down Expand Up @@ -538,7 +538,7 @@ property wrapper:
```

And the original code can now be updated to our custom initializer
``SwiftUI/NavigationStack/init(path:root:destination:fileID:line:)`` on `NavigationStack`:
``SwiftUI/NavigationStack/init(path:root:destination:fileID:filePath:line:column:)`` on `NavigationStack`:

```swift
NavigationStack(path: $store.scope(state: \.path, action: \.path)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Migrating to 1.9

Update your code to make use of the new ``TestStore/send(_:assert:file:line:)-1oopl`` method on
``TestStore`` which gives a succinct syntax for sending actions with case key paths, and the
``Reducer/dependency(_:)`` method for overriding dependencies.
Update your code to make use of the new ``TestStore/send(_:assert:fileID:file:line:column:)-8877x``
method on ``TestStore`` which gives a succinct syntax for sending actions with case key paths, and
the ``Reducer/dependency(_:)`` method for overriding dependencies.

## Overview

Expand All @@ -29,9 +29,10 @@ store.receive(\.child.presented.success, "Hello")
```

Version 1.9 introduces similar affordances for _sending_ actions to test stores via
``TestStore/send(_:assert:file:line:)-1oopl`` and ``TestStore/send(_:_:assert:file:line:)``. These
methods can significantly simplify integration-style tests that send deeply-nested actions to child
features, and provide symmetry to how actions are received:
``TestStore/send(_:assert:fileID:file:line:column:)-8877x`` and
``TestStore/send(_:_:assert:fileID:file:line:column:)``. These methods can significantly simplify
integration-style tests that send deeply-nested actions to child features, and provide symmetry to
how actions are received:

```diff
-store.send(.path(.element(id: 0, action: .destination(.presented(.record(.startButtonTapped))))))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use these tools.
- <doc:TreeBasedNavigation>
- ``Presents()``
- ``PresentationAction``
- ``Reducer/ifLet(_:action:destination:fileID:line:)-4k9by``
- ``Reducer/ifLet(_:action:destination:fileID:filePath:line:column:)-4ub6q``

### Stack-based navigation

Expand All @@ -30,7 +30,7 @@ use these tools.
- ``StackAction``
- ``StackActionOf``
- ``StackElementID``
- ``Reducer/forEach(_:action:destination:fileID:line:)-582rd``
- ``Reducer/forEach(_:action:destination:fileID:filePath:line:column:)-9svqb``

### Dismissal

Expand Down
Loading

0 comments on commit 3a02c5e

Please sign in to comment.