-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここでsyncer
とか書いても何も伝わらないような?
こことpackage.json
のdescription
を揃えるなら、これ単独でなんのライブラリか分かる説明が必要ですね
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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). |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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 }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使ってないのでProps不要ですね
一旦このPRは閉じて別ブランチにて構成から出し直します🙇♂️ |
No description provided.