-
Notifications
You must be signed in to change notification settings - Fork 81
Ability to use <script> element for initial page data
#299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
83bc454 to
514e272
Compare
514e272 to
3d7695c
Compare
Co-authored-by: Copilot <[email protected]>
docs/guide/configuration.md
Outdated
| > When using this option make sure your client-side Inertia setup is configured to read the page data from the `<script>` element. | ||
| > See the [protocol documentation](/guide/the-protocol#html-responses) for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I missed it in the protocol doc, but what actual client side configuration is required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, fixed
Support InertiaRails.once prop
Deploying inertia-rails with
|
| Latest commit: |
28f1aa9
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://722a1615.inertia-rails.pages.dev |
| Branch Preview URL: | https://render-data-in-script-tag.inertia-rails.pages.dev |
bknoles
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a cool feature! Good job Team Laravel!
This PR:
<script>element for initial page data via a newuse_script_element_for_initial_pageconfig option (see Optimize page data size and parsing (37% size reduction!) inertia#2687 and Ability to use<script>element for initial page data inertia-laravel#788)inertia_roothelper and ability to set custom DOM id for the root element viainertia_root(id:)or aroot_dom_idconfig option