Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "vendor/hotwire-bridge-components"]
path = vendor/hotwire-bridge-components
url = https://github.com/zumkorn/hotwire-bridge-components.git
url = https://github.com/inertia-native/bridge-components.git
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# inertia-native-docs

Documentation site for
[`inertia-hotwire-native`](https://github.com/zumkorn/inertia-hotwire-native) —
[`inertia-native`](https://github.com/inertia-native/inertia-native) —
running Inertia.js apps inside Hotwire Native (iOS & Android).

Built with [VitePress](https://vitepress.dev). Published to
Expand All @@ -10,12 +10,12 @@ Built with [VitePress](https://vitepress.dev). Published to
## Component registry submodule

Component pages embed their source straight from the
[hotwire-bridge-components](https://github.com/zumkorn/hotwire-bridge-components)
[bridge-components](https://github.com/inertia-native/bridge-components)
registry, vendored at `vendor/hotwire-bridge-components`. The build fails without
it, so clone with submodules:

```bash
git clone --recurse-submodules https://github.com/zumkorn/inertia-native-docs.git
git clone --recurse-submodules https://github.com/inertia-native/docs.git

# already cloned?
git submodule update --init
Expand Down
12 changes: 6 additions & 6 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export default defineConfig({
{
text: 'Links',
items: [
{ text: 'npm package', link: 'https://www.npmjs.com/package/inertia-hotwire-native' },
{ text: 'Web demo', link: 'https://github.com/zumkorn/inertia-native-demo' },
{ text: 'iOS demo', link: 'https://github.com/zumkorn/inertia-native-ios-demo' },
{ text: 'Android demo', link: 'https://github.com/zumkorn/inertia-native-android-demo' },
{ text: 'npm package', link: 'https://www.npmjs.com/package/inertia-native' },
{ text: 'Web demo', link: 'https://github.com/inertia-native/demo-rails' },
{ text: 'iOS demo', link: 'https://github.com/inertia-native/demo-ios' },
{ text: 'Android demo', link: 'https://github.com/inertia-native/demo-android' },
],
},
],
Expand Down Expand Up @@ -53,11 +53,11 @@ export default defineConfig({
],

socialLinks: [
{ icon: 'github', link: 'https://github.com/zumkorn/inertia-hotwire-native' },
{ icon: 'github', link: 'https://github.com/inertia-native/inertia-native' },
],

editLink: {
pattern: 'https://github.com/zumkorn/inertia-native-docs/edit/main/docs/:path',
pattern: 'https://github.com/inertia-native/docs/edit/main/docs/:path',
text: 'Edit this page on GitHub',
},

Expand Down
2 changes: 1 addition & 1 deletion docs/components/alert.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ all — the page is left exactly as it was.*
There is nothing to install. The files below are the complete component — paste
the web one plus whichever platforms you ship into your app, and change them
however you like. They are shown straight from the
[hotwire-bridge-components](https://github.com/zumkorn/hotwire-bridge-components/tree/main/registry/alert)
[bridge-components](https://github.com/inertia-native/bridge-components/tree/main/registry/alert)
registry, so what you see here is what the registry holds.
:::

Expand Down
2 changes: 1 addition & 1 deletion docs/components/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ by the web page below it.*
There is nothing to install. The files below are the complete component — paste
the web one plus whichever platforms you ship into your app, and change them
however you like. They are shown straight from the
[hotwire-bridge-components](https://github.com/zumkorn/hotwire-bridge-components/tree/main/registry/button)
[bridge-components](https://github.com/inertia-native/bridge-components/tree/main/registry/button)
registry, so what you see here is what the registry holds.
:::

Expand Down
6 changes: 3 additions & 3 deletions docs/components/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ regular browser.
The React entry exposes one generic primitive:

```js
import { useBridgeComponent } from 'inertia-hotwire-native/react'
import { useBridgeComponent } from 'inertia-native/react'
```

It returns whether the connected native app supports a component and a stable
Expand Down Expand Up @@ -67,7 +67,7 @@ subsequent interaction is reported twice.
## Ready-made components

Rather than writing each component from scratch, you can copy one from the
[hotwire-bridge-components](https://github.com/zumkorn/hotwire-bridge-components)
[bridge-components](https://github.com/inertia-native/bridge-components)
registry. It ships both halves — the web component and its Swift counterpart —
along with a contract describing the messages they exchange.

Expand All @@ -82,7 +82,7 @@ Inertia form looks like this:
```js
// hooks/useBridgeForm.js
import { useEffect, useRef } from 'react'
import { useBridgeComponent } from 'inertia-hotwire-native/react'
import { useBridgeComponent } from 'inertia-native/react'

export function useBridgeForm({ submitTitle, processing, onSubmit }) {
const { supported, send } = useBridgeComponent('form')
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Published under the `beta` tag while the API stabilizes. Install with `@beta`.
:::

```bash
npm add inertia-hotwire-native@beta
npm add inertia-native@beta
```

## Requirements

- `@inertiajs/core` >= 2.0 (works with the v3 line)
- `react` >= 18 — only for the `inertia-hotwire-native/react` entry
- `react` >= 18 — only for the `inertia-native/react` entry

## Setup

Expand All @@ -20,7 +20,7 @@ entrypoint:

```js
import { createInertiaApp } from '@inertiajs/react'
import { initHotwireNative } from 'inertia-hotwire-native'
import { initHotwireNative } from 'inertia-native'

const isHotwireNative = !!window.webkit?.messageHandlers?.turbo
initHotwireNative({ debug: import.meta.env.DEV || isHotwireNative })
Expand Down
14 changes: 7 additions & 7 deletions docs/guide/introduction.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Introduction

[`inertia-hotwire-native`](https://www.npmjs.com/package/inertia-hotwire-native)
[`inertia-native`](https://www.npmjs.com/package/inertia-native)
lets an [Inertia.js](https://inertiajs.com) application run inside
[Hotwire Native](https://native.hotwired.dev) (iOS & Android) and behave like a
native app.
Expand All @@ -24,18 +24,18 @@ navigates exactly as usual.

## Two entry points

- **Framework-agnostic core** (`inertia-hotwire-native`) — peer-depends on
- **Framework-agnostic core** (`inertia-native`) — peer-depends on
`@inertiajs/core`. Handles all navigation.
- **React bindings** (`inertia-hotwire-native/react`) — optional, peer-depends
- **React bindings** (`inertia-native/react`) — optional, peer-depends
on `react`. Provides `useBridgeComponent` for bridge components.

## The ecosystem

| Repository | What it is |
| --- | --- |
| [inertia-hotwire-native](https://github.com/zumkorn/inertia-hotwire-native) | The npm package |
| [inertia-native-demo](https://github.com/zumkorn/inertia-native-demo) | Web / Rails demo app |
| [inertia-native-ios-demo](https://github.com/zumkorn/inertia-native-ios-demo) | iOS Hotwire Native shell |
| [inertia-native-android-demo](https://github.com/zumkorn/inertia-native-android-demo) | Android Hotwire Native shell |
| [inertia-native](https://github.com/inertia-native/inertia-native) | The npm package |
| [demo-rails](https://github.com/inertia-native/demo-rails) | Web / Rails demo app |
| [demo-ios](https://github.com/inertia-native/demo-ios) | iOS Hotwire Native shell |
| [demo-android](https://github.com/inertia-native/demo-android) | Android Hotwire Native shell |

Next: [Installation](/guide/installation).
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hero:
link: /guide/installation
- theme: alt
text: GitHub
link: https://github.com/zumkorn/inertia-hotwire-native
link: https://github.com/inertia-native/inertia-native

features:
- title: Native navigation
Expand Down
2 changes: 1 addition & 1 deletion docs/native/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ any bridge components.

::: tip Reference app
A runnable example lives in
[inertia-native-android-demo](https://github.com/zumkorn/inertia-native-android-demo).
[demo-android](https://github.com/inertia-native/demo-android).
Clone it to see a working setup end to end.
:::

Expand Down
4 changes: 2 additions & 2 deletions docs/native/ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bridge components.

::: tip Reference app
A runnable example lives in
[inertia-native-ios-demo](https://github.com/zumkorn/inertia-native-ios-demo).
[demo-ios](https://github.com/inertia-native/demo-ios).
Clone it to see a working setup end to end.
:::

Expand All @@ -34,7 +34,7 @@ Hotwire.registerBridgeComponents([
```

Ready-made components — Swift source plus the matching web half — live in the
[hotwire-bridge-components](https://github.com/zumkorn/hotwire-bridge-components)
[bridge-components](https://github.com/inertia-native/bridge-components)
registry. See [Button](/components/button) for a worked example, including the
minimum SDK version they require.

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## `initHotwireNative`

```ts
import { initHotwireNative } from 'inertia-hotwire-native'
import { initHotwireNative } from 'inertia-native'

initHotwireNative(options?: { debug?: boolean }): void
```
Expand All @@ -22,7 +22,7 @@ is a no-op.
## `useBridgeComponent`

```ts
import { useBridgeComponent } from 'inertia-hotwire-native/react'
import { useBridgeComponent } from 'inertia-native/react'

useBridgeComponent(component: string): {
supported: boolean
Expand Down
Loading