@arponascension/express-inertia 1.6.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -157,6 +157,10 @@ app.listen(3000, () => console.log('Server running on http://localhost:3000'));
|
|
|
157
157
|
</html>
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
+
Keep the `inertia` attribute on the title element. It allows the Inertia
|
|
161
|
+
client adapter to replace the server-rendered title during client-side
|
|
162
|
+
navigation.
|
|
163
|
+
|
|
160
164
|
### 3. Configure the Vue 3 client (`src/main.ts`)
|
|
161
165
|
|
|
162
166
|
```ts
|
|
@@ -203,6 +207,34 @@ createInertiaApp({
|
|
|
203
207
|
});
|
|
204
208
|
```
|
|
205
209
|
|
|
210
|
+
Set page titles with Inertia's `Head` component, not only with a server prop.
|
|
211
|
+
The EJS root view is rendered only on the initial full-page request; subsequent
|
|
212
|
+
`<Link>` navigations receive JSON and do not render the EJS template again.
|
|
213
|
+
|
|
214
|
+
```tsx
|
|
215
|
+
import { Head } from '@inertiajs/react';
|
|
216
|
+
|
|
217
|
+
export default function Dashboard() {
|
|
218
|
+
return (
|
|
219
|
+
<>
|
|
220
|
+
<Head title="Dashboard" />
|
|
221
|
+
<h1>Dashboard</h1>
|
|
222
|
+
</>
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
For a shared suffix, configure the callback once:
|
|
228
|
+
|
|
229
|
+
```tsx
|
|
230
|
+
createInertiaApp({
|
|
231
|
+
titleCallback: (title) => `${title} | My App`,
|
|
232
|
+
// resolve and setup...
|
|
233
|
+
});
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
For Vue, use the equivalent `Head` component from `@inertiajs/vue3`.
|
|
237
|
+
|
|
206
238
|
For React, use a `.tsx` entrypoint in the root view and include `<%- viteReactRefresh() %>` before `<%- vite('src/main.tsx') %>`:
|
|
207
239
|
|
|
208
240
|
```html
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arponascension/express-inertia",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "Inertia.js adapter and middleware for Express.js — build SPAs with Vue 3, React, or Svelte using classic server-side routing, EJS templates, Vite, and server-side rendering (SSR).",
|
|
5
5
|
"homepage": "https://github.com/arponascension/express-inertia#readme",
|
|
6
6
|
"repository": {
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"LICENSE"
|
|
38
38
|
],
|
|
39
39
|
"scripts": {
|
|
40
|
+
"prepare": "npm run build",
|
|
40
41
|
"build": "tsup",
|
|
41
42
|
"dev": "tsup --watch",
|
|
42
43
|
"test": "vitest run",
|