Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add package's docs #6

Closed
wants to merge 1 commit into from
Closed

add package's docs #6

wants to merge 1 commit into from

Conversation

AkifumiSato
Copy link
Collaborator

No description provided.

Copy link
Member

@koichik koichik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一端途中までコメント
ドキュメントとしては

  • このライブラリが何なのかか分かる
  • 最低限の使い方が分かる
  • 詳細な使い方が分かる

という流れにしたいです
若干なんかこう、中のことを分かってる人が書いてる感がにじみ出てるように見えちゃう

あとAPIドキュメントを整える前にもう少しライブラリの実装自体を進めたいかな


TBW
- [@location-state/core](./packages/location-state-core/README.md)
- [@location-state/next](./packages/location-state-next/README.md)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

リポジトリを見に来る人が最初に見るのがこのREADMEなのでライブラリの概要はここだけで見れるようにしたいお気持ち
APIリファレンス的なのはそれぞれのパッケージに誘導で十分だけど

@@ -0,0 +1,124 @@
# @location-state/core

`@location-state/core` provides the features to save and restore state based on a specified `syncer`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここでsyncerとか書いても何も伝わらないような?
こことpackage.jsondescriptionを揃えるなら、これ単独でなんのライブラリか分かる説明が必要ですね
npmjs.orgのサーチ結果等で見れるのはこれなので
つまりこのライブラリのことを何も知らない人にこれが何なのかをわかるようにしたい
とすると絶対に伝えたいのは

  • React向けの
  • 状態管理ライブラリで
  • 履歴エントリと同期して
  • Next.js App Routerをサポート

辺りじゃないかなぁと
たとえば上を適当にDeepLすると:

State management library for React that synchronizes with history entries supporting Next.js App Router


## Usage

Specify the syncer props in Provider that based on the navigation API.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここというかトップレベルのREADMEに書きたいことだけど、最初のUsageでいきなりsyncerとか出したくないかな
最小限のデフォルト構成を紹介したい

```

> [!WARNING]
> Please note that the navigation API is not yet supported by some browsers as of 2023.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここはもっとストレートにChromiumベースのブラウザでしか使えないと明記したいかな


> [!WARNING]
> Please note that the navigation API is not yet supported by some browsers as of 2023.
> If you want, you can use `import { unsafeNavigation } from "@location-state/core/unsafe-navigation";` at your own risk.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これは別の見出しを切ってちゃんとしたコード例として載せたい

> If you want, you can use `import { unsafeNavigation } from "@location-state/core/unsafe-navigation";` at your own risk.
> However, this is not a perfect complement to the Navigation API.

If you are using Next.js pages router, use [@location-state/next](../location-state-next/README.md).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これはUsageの冒頭に書きたいかな

You can store history-based information in session storage by specifying `store: 'session'`, name, and default value in hooks.

```tsx
import { useLocationState, StoreName } from "@location-state/core";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このサンプルではStoreName不要では

```tsx
import { useLocationState, StoreName } from "@location-state/core";

export function Counter({ storeName }: { storeName: StoreName }) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使ってないのでProps不要ですね

@AkifumiSato
Copy link
Collaborator Author

一旦このPRは閉じて別ブランチにて構成から出し直します🙇‍♂️

@AkifumiSato AkifumiSato mentioned this pull request Sep 15, 2023
@AkifumiSato AkifumiSato deleted the docs branch September 17, 2023 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants