Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions packages/docs/public/llms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# JARL: Atomic Routing Library

> A controlled-component router for React built on jotai atoms: each route is its own atom,

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

"controlled-component" inaccurate and contradictory here, also "for React" also not exclusively true as atoms can be used independently. Instead: "A router for React and vanilla JS projects, build on Jotai atoms:"

> matching a URL segment and reversible back into a URL. Framework-agnostic core (`jarl-atoms`)
> with lightweight React bindings (`jarl-react`).

- Install both packages plus their `jotai` peer dependency: `npm install jarl-atoms jarl-react jotai`.
The npm package names are `jarl-atoms` and `jarl-react` — the GitHub repository is
`randomdevpete/jarl`, but the packages kept their pre-rename names; do not guess `jarl` or

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

"kept their pre-rename names" historical fluff, LLM doesn't need anything about the rename here

`@jarl/*`.
- The current major is v2, built entirely on jotai atoms. The v1 implementation (`RoutingProvider`,
`RouteMap`, React legacy context) was removed from the codebase; v1-era snippets found elsewhere

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Can you confirm that any such snippets can be found anywhere? This library was never in common use so it seems unlikely.

online do not apply.
- `jarl-react` does not re-export `jarl-atoms`. Import route atoms (`rootAtom`, `staticRouteAtom`,
`paramRouteAtom`, ...) from `jarl-atoms`, and components/hooks (`Route`, `Link`, `Switch`,
`useNavigate`, ...) from `jarl-react`.
- `jarl-react` also peer-depends on React `^18 || ^19`.

## Guides

- [Getting started](https://jarl.randomdev.co.uk/docs/getting-started): route atoms, the jotai
`Provider`, `Route` and `Link`, a minimal working app
- [Path variables](https://jarl.randomdev.co.uk/docs/path-variables): dynamic segments, nested
routes, query params
- [Data loading](https://jarl.randomdev.co.uk/docs/data-loading): `resolvedAtom` and
`asyncRouteAtom`, Suspense-based loading

## API reference

- [jarl-atoms](https://jarl.randomdev.co.uk/api/jarl-atoms): route atom constructors, redirects,
query atoms
- [jarl-react](https://jarl.randomdev.co.uk/api/jarl-react): `Route`, `Link`, `Switch`, hooks

## Optional

- [Changelog](https://jarl.randomdev.co.uk/changelog): version-by-version release notes
- [v1 history](https://jarl.randomdev.co.uk/history): why v1 was replaced — background only, not
current API
Loading