Skip to content

Commit 0d5cc00

Browse files
committed
wip
1 parent 10be3cb commit 0d5cc00

File tree

7 files changed

+26
-26
lines changed

7 files changed

+26
-26
lines changed

v1/advanced/server-side-rendering.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ title: Server-Side Rendering (SSR)
33
---
44

55
import { ClientSpecific } from "/snippets/client-specific.jsx"
6-
import { VueSpecific } from "/snippets/vue-specific.jsx"
76
import { ReactSpecific } from "/snippets/react-specific.jsx"
87
import { SvelteSpecific } from "/snippets/svelte-specific.jsx"
8+
import { VueSpecific } from "/snippets/vue-specific.jsx"
99

1010
<Warning>This is documentation for Inertia.js v1, which is no longer actively maintained. Please refer to the [v2 docs](/v2) for the latest information.</Warning>
1111

@@ -197,11 +197,11 @@ With the server running, you should be able to access your app within the browse
197197

198198
Since your website is now being server-side rendered, you can instruct <VueSpecific>Vue</VueSpecific><ReactSpecific>React</ReactSpecific><SvelteSpecific>Svelte</SvelteSpecific> to "hydrate" the static markup and make it interactive instead of re-rendering all the HTML that we just generated.
199199

200-
<vue2>Inertia automatically enables client-side hydration in Vue 2 apps, so no changes are required.
200+
{/* <vue2>Inertia automatically enables client-side hydration in Vue 2 apps, so no changes are required. */}
201201

202-
</vue2><vue3>To enable client-side hydration in a Vue 3 app, update your `app.js` file to use `createSSRApp` instead of `createApp`:
202+
{/* </vue2><vue3>To enable client-side hydration in a Vue 3 app, update your `app.js` file to use `createSSRApp` instead of `createApp`: */}
203203

204-
</vue3><ReactSpecific>To enable client-side hydration in a React app, update your `app.js` file to use `hydrateRoot` instead of `createRoot`:</ReactSpecific><SvelteSpecific>To enable client-side hydration in a Svelte app, set the `hydratable` compiler option to `true` in your `vite.config.js` file:</SvelteSpecific>
204+
{/* </vue3><ReactSpecific>To enable client-side hydration in a React app, update your `app.js` file to use `hydrateRoot` instead of `createRoot`:</ReactSpecific><SvelteSpecific>To enable client-side hydration in a Svelte app, set the `hydratable` compiler option to `true` in your `vite.config.js` file:</SvelteSpecific> */}
205205

206206
<CodeGroup>
207207

@@ -269,7 +269,7 @@ Since your website is now being server-side rendered, you can instruct <VueSpeci
269269

270270
</CodeGroup>
271271

272-
<SvelteSpecific>You'll also need to enable hydration in your `app.js` file:
272+
{/* <SvelteSpecific>You'll also need to enable hydration in your `app.js` file: */}
273273

274274
```diff
275275
import { createInertiaApp } from '@inertiajs/svelte'

v1/core-concepts/how-it-works.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ However, Inertia replaces your application's view layer. Instead of using server
1010

1111
As you might expect, simply creating your frontend in JavaScript doesn't give you a single-page application experience. If you were to click a link, your browser would make a full page visit, which would then cause your client-side framework to reboot on the subsequent page load. This is where Inertia changes everything.
1212

13-
At its core, Inertia is essentially a client-side routing library. It allows you to make page visits without forcing a full page reload. This is done using the `{`<a>`}</a>` component, a light-weight wrapper around a normal anchor link. When you click an Inertia link, Inertia intercepts the click and makes the visit via XHR instead. You can even make these visits programmatically in JavaScript using `router.visit()`.
13+
At its core, Inertia is essentially a client-side routing library. It allows you to make page visits without forcing a full page reload. This is done using the `<Link>` component, a light-weight wrapper around a normal anchor link. When you click an Inertia link, Inertia intercepts the click and makes the visit via XHR instead. You can even make these visits programmatically in JavaScript using `router.visit()`.
1414

1515
When Inertia makes an XHR visit, the server detects that it's an Inertia visit and, instead of returning a full HTML response, it returns a JSON response with the JavaScript page component name and data (props). Inertia then dynamically swaps out the previous page component with the new page component and updates the browser's history state.
1616

v1/core-concepts/the-protocol.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ This page contains a detailed specification of the Inertia protocol. Be sure to
1010

1111
The very first request to an Inertia app is just a regular, full-page browser request, with no special Inertia headers or data. For these requests, the server returns a full HTML document.
1212

13-
This HTML response includes the site assets (CSS, JavaScript) as well as a root `{`<div>`} in thepage's body. The root {`<div>`} serves as a mounting point for the client-side app, and includes adata-page attribute with a JSON encoded <a href="#the-page-object">page object</a> for the initialpage. Inertia uses this information to boot your client-side framework and display the initial page component.<div classname="overflow-hidden rounded"><div classname="px-6 pt-6 font-mono text-sm text-white"><div classname="text-xs font-bold uppercase text-gray-600">Request</div><div classname="mt-1"><span classname="text-blue-400">GET:</span> http://example.com/events/80</div><div><span classname="text-blue-400">Accept:</span> text/html, application/xhtml+xml</div><div classname="mt-8 text-xs font-bold uppercase text-gray-600">Response</div><div classname="mt-1">HTTP/1.1 200 OK</div><div><span classname="text-blue-400">Content-Type:</span> text/html; charset=utf-8</div></div><p><codeblock>mT5keZcVVw</codeblock></p><p><codeblock>tGbPYOhrQq</codeblock></p><p><codeblock>73mMeawQzt</codeblock></p></div></div></div>`
13+
{/* This HTML response includes the site assets (CSS, JavaScript) as well as a root `<div>` in the page's body. The root `<div>` serves as a mounting point for the client-side app, and includes adata-page attribute with a JSON encoded <a href="#the-page-object">page object</a> for the initialpage. Inertia uses this information to boot your client-side framework and display the initial page component.<div classname="overflow-hidden rounded"><div classname="px-6 pt-6 font-mono text-sm text-white"><div classname="text-xs font-bold uppercase text-gray-600">Request</div><div classname="mt-1"><span classname="text-blue-400">GET:</span> http://example.com/events/80</div><div><span classname="text-blue-400">Accept:</span> text/html, application/xhtml+xml</div><div classname="mt-8 text-xs font-bold uppercase text-gray-600">Response</div><div classname="mt-1">HTTP/1.1 200 OK</div><div><span classname="text-blue-400">Content-Type:</span> text/html; charset=utf-8</div></div><p><codeblock>mT5keZcVVw</codeblock></p><p><codeblock>tGbPYOhrQq</codeblock></p><p><codeblock>73mMeawQzt</codeblock></p></div></div></div>` */}

v1/getting-started/upgrade-guide.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,19 +234,19 @@ Finally, if you have defined any progress customizations, you can move them to t
234234

235235
```js
236236
createInertiaApp({
237-
progress: {
238-
color: '#29d',
239-
},
240-
// ...
237+
progress: {
238+
color: '#29d',
239+
},
240+
// ...
241241
})
242242
```
243243

244244
If you're using a custom progress indicator, you can disable the default progress indicator by setting the `progress` property to `false`.
245245

246246
```js
247247
createInertiaApp({
248-
progress: false,
249-
// ...
248+
progress: false,
249+
// ...
250250
})
251251
```
252252

@@ -256,10 +256,10 @@ We've removed the previously deprecated lowercase `app` argument from the `setup
256256

257257
```diff
258258
createInertiaApp({
259-
// ...
259+
// ...
260260
- setup({ app, props }) {
261261
+ setup({ App, props }) {
262-
// ...
262+
// ...
263263
},
264264
})
265265
```

v1/installation/server-side-setup.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ composer require inertiajs/inertia-laravel
2424

2525
Next, setup the root template that will be loaded on the first page visit to your application. This will be used to load your site assets (CSS and JavaScript), and will also contain a root `<div>` in which to boot your JavaScript application.
2626

27-
```html
28-
27+
```blade
2928
<html>
3029
<head>
3130
<meta charset="utf-8" />
@@ -55,10 +54,11 @@ Once the middleware has been published, append the `HandleInertiaRequests` middl
5554

5655
```php
5756
use App\Http\Middleware\HandleInertiaRequests;
57+
5858
->withMiddleware(function (Middleware $middleware) {
59-
$middleware->web(append: [
60-
HandleInertiaRequests::class,
61-
]);
59+
$middleware->web(append: [
60+
HandleInertiaRequests::class,
61+
]);
6262
})
6363
```
6464

v1/the-basics/pages.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
title: Pages
33
---
44

5-
import { VueSpecific } from "/snippets/vue-specific.jsx"
65
import { ReactSpecific } from "/snippets/react-specific.jsx"
76
import { SvelteSpecific } from "/snippets/svelte-specific.jsx"
7+
import { VueSpecific } from "/snippets/vue-specific.jsx"
88

99
<Warning>This is documentation for Inertia.js v1, which is no longer actively maintained. Please refer to the [v2 docs](/v2) for the latest information.</Warning>
1010

@@ -113,7 +113,7 @@ class UserController extends Controller
113113

114114
## Creating Layouts
115115

116-
While not required, for most projects it makes sense to create a site layout that all of your pages can extend. You may have noticed in our page example above that we're wrapping the page content within a `{`<layout>`}</layout>` component. Here's an example of such a component:
116+
{/* While not required, for most projects it makes sense to create a site layout that all of your pages can extend. You may have noticed in our page example above that we're wrapping the page content within a `{`<layout>`}</layout>` component. Here's an example of such a component: */}
117117

118118
<CodeGroup>
119119

@@ -388,14 +388,14 @@ export default Home
388388

389389
</CodeGroup>
390390

391-
<VueSpecific>If you're using Vue 2.7 or Vue 3, you can alternatively use the [defineOptions plugin](https://vue-macros.sxzz.moe/macros/define-options.html) to define a layout within `<script setup>`:
391+
{/* <VueSpecific>If you're using Vue 2.7 or Vue 3, you can alternatively use the [defineOptions plugin](https://vue-macros.sxzz.moe/macros/define-options.html) to define a layout within `<script setup>`: */}
392392

393-
```html
393+
{/* ```html
394394
<script setup>
395395
import Layout from './Layout'
396396
defineOptions({ layout: Layout })
397397
</script>
398-
```</VueSpecific>## Default layouts
398+
```</VueSpecific>## Default layouts */}
399399

400400
If you're using persistent layouts, you may find it convenient to define the default page layout in the `resolve()` callback of your application's main JavaScript file.
401401

v1/the-basics/redirects.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Redirects
44

55
<Warning>This is documentation for Inertia.js v1, which is no longer actively maintained. Please refer to the [v2 docs](/v2) for the latest information.</Warning>
66

7-
When making a non-GET Inertia request manually or via a `{`<a>`}</a>` element, you should ensure that you always respond with a proper Inertia redirect response.
7+
{/* When making a non-GET Inertia request manually or via a `{`<a>`}</a>` element, you should ensure that you always respond with a proper Inertia redirect response. */}
88

99
For example, if your controller is creating a new user, your "store" endpoint should return a redirect back to a standard `GET` endpoint, such as your user "index" page. Inertia will automatically follow this redirect and update the page accordingly.
1010

0 commit comments

Comments
 (0)