You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You may have noticed we're returning an `Error` page component in the example above. You'll need to actually create this component, which will serve as the generic error page for your application. Here's an example error component you can use as a starting point.
31
+
You may have noticed we're returning an `ErrorPage` page component in the example above. You'll need to actually create this component, which will serve as the generic error page for your application. Here's an example error component you can use as a starting point.
Copy file name to clipboardExpand all lines: docs/guide/responses.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -235,4 +235,4 @@ You can find the default templates in the gem's source code:
235
235
236
236
To enable client-side history navigation, all Inertia server responses are stored in the browser's history state. However, keep in mind that some browsers impose a size limit on how much data can be saved within the history state.
237
237
238
-
For example, [Firefox](https://developer.mozilla.org/en-US/docs/Web/API/History/pushState) has a size limit of 640k characters and throws a `NS_ERROR_ILLEGAL_VALUE` error if you exceed this limit. Typically, this is much more data than you'll ever practically need when building applications.
238
+
For example, [Firefox](https://developer.mozilla.org/en-US/docs/Web/API/History/pushState) has a size limit of 16 MiB and throws a `NS_ERROR_ILLEGAL_VALUE` error if you exceed this limit. Typically, this is much more data than you'll ever practically need when building applications.
<div id="app" data-page='{"component":"Event","props":{"event":{"id":80,"title":"Birthday party","start_date":"2019-06-02","description":"Come out and celebrate Jonathan's 36th birthday party!"}},"url":"/events/80","version":"c32b8e4965f418ad16eaebba1d4e960f"}'></div>
29
+
<div id="app" data-page='{"component":"Event","props":{"errors":{},"event":{"id":80,"title":"Birthday party","start_date":"2019-06-02","description":"Come out and celebrate Jonathan's 36th birthday party!"}},"url":"/events/80","version":"c32b8e4965f418ad16eaebba1d4e960f"}'></div>
30
30
31
31
</body>
32
32
</html>
@@ -58,6 +58,7 @@ X-Inertia: true
58
58
{
59
59
"component": "Event",
60
60
"props": {
61
+
"errors": {},
61
62
"event": {
62
63
"id": 80,
63
64
"title": "Birthday party",
@@ -77,7 +78,7 @@ X-Inertia: true
77
78
Inertia shares data between the server and client via a page object. This object includes the necessary information required to render the page component, update the browser's history state, and track the site's asset version. The page object includes the following four properties:
78
79
79
80
1.`component`: The name of the JavaScript page component.
80
-
2.`props`: The page props (data).
81
+
2.`props`: The page props. Contains all of the page data along with an `errors` object (defaults to `{}` if there are no errors).
81
82
3.`url`: The page URL.
82
83
4.`version`: The current asset version.
83
84
5.`encryptHistory`: Whether or not to encrypt the current page's history state.
When making Inertia requests, the partial reload option allows you to request a subset of the props (data) from the server on subsequent visits to the same page component. This can be a helpful performance optimization if it's acceptable that some page data becomes stale.
118
119
119
-
When a partial reload request is made, Inertia includes two additional headers with the request:`X-Inertia-Partial-Data` and `X-Inertia-Partial-Component`.
120
+
When a partial reload request is made, Inertia includes the `X-Inertia-Partial-Component` header and may include`X-Inertia-Partial-Data` and/or`X-Inertia-Partial-Except` headers with the request.
120
121
121
122
The `X-Inertia-Partial-Data` header is a comma separated list of the desired props (data) keys that should be returned.
122
123
123
-
The `X-Inertia-Partial-Component` header includes the name of the component that is being partially reloaded. This is necessary, since partial reloads only work for requests made to the same page component. If the final destination is different for some reason (eg. the user was logged out and is now on the login page), then no partial reloading will occur.
124
+
The `X-Inertia-Partial-Except` header is a comma separated list of the props (data) keys that should not be returned. When only the `X-Inertia-Partial-Except` header is included, all props (data) except those listed will be sent. If both `X-Inertia-Partial-Data` and `X-Inertia-Partial-Except` headers are included, the `X-Inertia-Partial-Except` header will take precedence.
125
+
126
+
The `X-Inertia-Partial-Component` header includes the name of the component that is being partially reloaded. This is necessary, since partial reloads only work for requests made to the same page component. If the final destination is different for some reason (e.g. the user was logged out and is now on the login page), then no partial reloading will occur.
0 commit comments