Skip to content

Commit

Permalink
Merge pull request #6 from soil-kt/alpha02
Browse files Browse the repository at this point in the history
The documentation has been rewritten for version 1.0.0-alpha02
  • Loading branch information
ogaclejapan authored Jun 2, 2024
2 parents 584b09e + f332315 commit b7d4660
Show file tree
Hide file tree
Showing 11 changed files with 709 additions and 621 deletions.
2 changes: 1 addition & 1 deletion guide/form/hello-form.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ fun App() {

Have you understood the basics of using Query? This concludes the tutorial :confetti_ball:

If you wish to continue learning, it would be a good idea to try running the `FormScreen` found in the [sample](https://github.com/soil-kt/soil/tree/main/sample/) code.
If you wish to continue learning, it would be a good idea to try running the `FormScreen` found in the [sample](https://github.com/soil-kt/soil/tree/1.0.0-alpha02/sample/) code.
If you have any concerns, please feel free to provide feedback on [Github discussions](https://github.com/soil-kt/soil/discussions).

Love the project? :star: it on [GitHub](https://github.com/soil-kt/soil) and help us make it even better!
Empty file removed guide/form/wip.md
Empty file.
6 changes: 3 additions & 3 deletions guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ If your browser supports [WasmGC](https://github.com/WebAssembly/gc), you can ru

:point_right: [Sample App](https://play.soil-kt.com/)

Source code: <https://github.com/soil-kt/soil/tree/main/sample/>
Source code: <https://github.com/soil-kt/soil/tree/1.0.0-alpha02/sample/>

::: info Browser Support for WasmGC
Currently, the only browsers that support WasmGC are Chrome and Firefox.
Expand Down Expand Up @@ -38,7 +38,7 @@ repositories {

```kts [Dependencies]
dependencies {
val soil = "1.0.0-alpha01"
val soil = "1.0.0-alpha02"
implementation("com.soil-kt.soil:query-core:$soil")
implementation("com.soil-kt.soil:query-compose:$soil")
implementation("com.soil-kt.soil:query-compose-runtime:$soil")
Expand All @@ -49,7 +49,7 @@ dependencies {

```yaml [Version Catalog]
[versions]
soil = "1.0.0-alpha01"
soil = "1.0.0-alpha02"

[libraries]
soil-query-core = { module = "com.soil-kt.soil:query-core", version.ref = "soil" }
Expand Down
2 changes: 1 addition & 1 deletion guide/query/hello-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ The key settings in `QueryOptions` are as follows:

Have you understood the basics of using Query? This concludes the tutorial :confetti_ball:

If you wish to continue learning, it would be a good idea to try running the `QueryScreen` found in the [sample](https://github.com/soil-kt/soil/tree/main/sample/) code.
If you wish to continue learning, it would be a good idea to try running the `QueryScreen` found in the [sample](https://github.com/soil-kt/soil/tree/1.0.0-alpha02/sample/) code.
If you have any concerns, please feel free to provide feedback on [Github discussions](https://github.com/soil-kt/soil/discussions).

Love the project? :star: it on [GitHub](https://github.com/soil-kt/soil) and help us make it even better!
33 changes: 18 additions & 15 deletions guide/space/hello-space.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,27 @@ val counter2Atom = atom(0, saverKey = "counter2", navGraphScope)
In Step 3, only one `AtomStore` was specified as an argument for `AtomRoot`.
Multiple `AtomStore` and a `fallbackScope` can also be passed as variations of arguments for `AtomRoot`.

The following code utilizes two types of scopes that depend on the lifecycle of the navigation library [Voyager](https://github.com/adrielcafe/voyager), used in the sample app. With Voyager, you can manage states on a per-screen basis and across the entire navigation.
The following code is an example managing state with two different scopes that depend on the `NavBackStackEntry` of the navigation library [androidx.Navigation](https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-navigation-routing.html) used in the sample app:

- [ScreenModel | Voyager](https://voyager.adriel.cafe/screenmodel)
- currentScreen: Saves the state using the `BackStackEntry` of the current screen
- navScreen: Saves the state using the `BackStackEntry` of the root screen

```kotlin
// sample - space:
class HelloSpaceScreen : Screen {

@Composable
override fun Content() {
val navigator = LocalNavigator.currentOrThrow
AtomRoot(
currentScreen to rememberScreenStore(),
navScreen to navigator.rememberNavigatorScreenStore(),
fallbackScope = { currentScreen }
) {
// ..
}
@Composable
fun HelloSpaceScreen(
navStore: AtomStore
) {
AtomRoot(
currentScreen to rememberViewModelStore(),
navScreen to navStore,
fallbackScope = { currentScreen }
// If fallbackScope is set to navScreen, the value of Counter is preserved even if it navigates back and then forward again.
// fallbackScope = { navScreen }
) {
HelloSpaceContent(
modifier = Modifier.fillMaxSize()
)
}
}
```
Expand All @@ -135,7 +138,7 @@ Managing all these states within a single scope can be a strict constraint from

Have you understood the basics of using Space? This concludes the tutorial :confetti_ball:

If you wish to continue learning, it would be a good idea to try running the `SpaceScreen` found in the [sample](https://github.com/soil-kt/soil/tree/main/sample/) code.
If you wish to continue learning, it would be a good idea to try running the `SpaceScreen` found in the [sample](https://github.com/soil-kt/soil/tree/1.0.0-alpha02/sample/) code.
If you have any concerns, please feel free to provide feedback on [Github discussions](https://github.com/soil-kt/soil/discussions).

Love the project? :star: it on [GitHub](https://github.com/soil-kt/soil) and help us make it even better!
2 changes: 1 addition & 1 deletion ja/guide/form/hello-form.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ fun App() {

Form の基本的な使い方は理解できましたか? これでチュートリアルは完了です :confetti_ball:

学習を続けたい場合は、[sample](https://github.com/soil-kt/soil/tree/main/sample/) コード内の `FormScreen` を動かしてみるのがよいでしょう。
学習を続けたい場合は、[sample](https://github.com/soil-kt/soil/tree/1.0.0-alpha02/sample/) コード内の `FormScreen` を動かしてみるのがよいでしょう。
ぜひ、試して気になるところがあれば [Github discussions](https://github.com/soil-kt/soil/discussions) にフィードバックをお寄せください。

Soil プロジェクトに興味がありますか?<br/>
Expand Down
6 changes: 3 additions & 3 deletions ja/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Soil の Kotlin Multiplatform ライブラリは、実験的な [Kotlin Wasm](ht

:point_right: [Sample App](https://play.soil-kt.com/)

Source code: <https://github.com/soil-kt/soil/tree/main/sample/>
Source code: <https://github.com/soil-kt/soil/tree/1.0.0-alpha02/sample/>

::: info ブラウザの WasmGC 対応状況について
現在、WasmGC に対応しているブラウザは Chrome と Firefox のみです。
Expand Down Expand Up @@ -37,7 +37,7 @@ repositories {

```kts [Dependencies]
dependencies {
val soil = "1.0.0-alpha01"
val soil = "1.0.0-alpha02"
implementation("com.soil-kt.soil:query-core:$soil")
implementation("com.soil-kt.soil:query-compose:$soil")
implementation("com.soil-kt.soil:query-compose-runtime:$soil")
Expand All @@ -48,7 +48,7 @@ dependencies {

```yaml [Version Catalog]
[versions]
soil = "1.0.0-alpha01"
soil = "1.0.0-alpha02"

[libraries]
soil-query-core = { module = "com.soil-kt.soil:query-core", version.ref = "soil" }
Expand Down
2 changes: 1 addition & 1 deletion ja/guide/query/hello-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class HelloQueryKey : QueryKey<String> by buildQueryKey(

Query の基本的な使い方は理解できましたか? これでチュートリアルは完了です :confetti_ball:

学習を続けたい場合は、[sample](https://github.com/soil-kt/soil/tree/main/sample/) コード内の `QueryScreen` を動かしてみるのがよいでしょう。
学習を続けたい場合は、[sample](https://github.com/soil-kt/soil/tree/1.0.0-alpha02/sample/) コード内の `QueryScreen` を動かしてみるのがよいでしょう。
ぜひ、試して気になるところがあれば [Github discussions](https://github.com/soil-kt/soil/discussions) にフィードバックをお寄せください。

Soil プロジェクトに興味がありますか?<br/>
Expand Down
33 changes: 18 additions & 15 deletions ja/guide/space/hello-space.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,27 @@ val counter2Atom = atom(0, saverKey = "counter2", navGraphScope)
Step 3で定義した `AtomRoot` には1つの `AtomStore` のみを引数に指定していました。
`AtomRoot` の引数バリエーションとして複数の `AtomStore``fallbackScope` を渡すことも可能です。

次のコードはサンプルアプリに利用しているナビゲーションライブラリ [Voyager](https://github.com/adrielcafe/voyager) のライフサイクルに依存した2種類のスコープです。Voyager では、画面単位とナビゲーション全体にわたって状態を管理できます
次のコードはサンプルアプリに利用しているナビゲーションライブラリ [androidx.Navigation](https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-navigation-routing.html)`NavBackStackEntry` に依存した2種類のスコープで状態を管理している例です

- [ScreenModel | Voyager](https://voyager.adriel.cafe/screenmodel)
- currentScreen: 現在の画面のBackStackEntryを利用して状態を保存する
- navScreen: ルート画面のBackStackEntryを利用して状態を保存する

```kotlin
// sample - space:
class HelloSpaceScreen : Screen {

@Composable
override fun Content() {
val navigator = LocalNavigator.currentOrThrow
AtomRoot(
currentScreen to rememberScreenStore(),
navScreen to navigator.rememberNavigatorScreenStore(),
fallbackScope = { currentScreen }
) {
// ..
}
@Composable
fun HelloSpaceScreen(
navStore: AtomStore
) {
AtomRoot(
currentScreen to rememberViewModelStore(),
navScreen to navStore,
fallbackScope = { currentScreen }
// If fallbackScope is set to navScreen, the value of Counter is preserved even if it navigates back and then forward again.
// fallbackScope = { navScreen }
) {
HelloSpaceContent(
modifier = Modifier.fillMaxSize()
)
}
}
```
Expand All @@ -133,7 +136,7 @@ UI上で表現したい状態には、コンポーネントの内部状態から

Space の基本的な使い方は理解できましたか? これでチュートリアルは完了です :confetti_ball:

学習を続けたい場合は、[sample](https://github.com/soil-kt/soil/tree/main/sample/) コード内の `SpaceScreen` を動かしてみるのがよいでしょう。
学習を続けたい場合は、[sample](https://github.com/soil-kt/soil/tree/1.0.0-alpha02/sample/) コード内の `SpaceScreen` を動かしてみるのがよいでしょう。
ぜひ、試して気になるところがあれば [Github discussions](https://github.com/soil-kt/soil/discussions) にフィードバックをお寄せください。

Soil プロジェクトに興味がありますか?<br/>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"engines": {
"node": ">=18.0.0"
},
"packageManager": "pnpm@8.15.6+sha256.01c01eeb990e379b31ef19c03e9d06a14afa5250b82e81303f88721c99ff2e6f"
"packageManager": "pnpm@9.1.4+sha256.30a1801ac4e723779efed13a21f4c39f9eb6c9fbb4ced101bce06b422593d7c9"
}
Loading

0 comments on commit b7d4660

Please sign in to comment.