Skip to content

Commit

Permalink
Update migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
zsoltk committed Jan 18, 2024
1 parent 7770a5c commit 4e3451f
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions documentation/releases/2.0.0-alpha10.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ fun SomeComposable() {
)
}
```

## Rename `BuildContext` & `buildContext`

```diff
Expand Down Expand Up @@ -141,9 +142,39 @@ class YourNode(
}
```

 

# Changes unlikely to affect you directly

## Changes to `NodeView`

You only need to care about these changes if you separated out your view to a class implementing the `NodeView` interface.

If you implemented your `@Composable override fun Content(modifier: Modifier)` directly in your `Node`, you don't need to do anything.

1. **We've dropped generics from `NodeView` interface**

```diff
-interface NodeView<NavTarget : Any>
+interface NodeView
```

If you had an implementation of this interface, drop the generic from your class too.

2. **We've unified `NodeView` and `ParentNodeView`**

If you used `ParentNodeView`, just replace the usage with `NodeView`.

3. **We've unified `EmptyNodeView` and `EmptyParentNodeView`**

If you used `EmptyParentNodeView`, just replace the usage with `EmptyNodeView`.


## Swap the order of `TargetUiState`, `MutableUiState`

You only need to do this if you implemented your own `Visualisation`. If you only relied on the ones supplied by the library, you don't need to do anything.


```diff
class SomeVisualisation(
/*...*/
Expand All @@ -154,7 +185,13 @@ class SomeVisualisation(

## KSP generated method name change

You only need to do this if you implemented your own `Visualisation`. If you only relied on the ones supplied by the library, you don't need to do anything.

```diff
-targetUiState.toMutableState()
+targetUiState.toMutableUiState()
override fun mutableUiStateFor(
uiContext: UiContext,
targetUiState: TargetUiState
): MutableUiState =
- targetUiState.toMutableState(uiContext)
+ targetUiState.toMutableUiState(uiContext)
```

0 comments on commit 4e3451f

Please sign in to comment.