Skip to content

Add prefetch and nonce to assets/1 - #32

Open
osbre wants to merge 2 commits into
LostKobrakai:mainfrom
osbre:prefetch
Open

osbre wants to merge 2 commits into
LostKobrakai:mainfrom
osbre:prefetch

Conversation

@osbre

@osbre osbre commented Oct 1, 2026 •

Copy link
Copy Markdown

One feature I miss coming from Laravel is their Vite::prefetch() (laravel/framework#52462).

It downloads lazily loaded chunks in the background once the page has loaded. With Inertia, that means the next page's code is already cached when you navigate.

<PhoenixVite.Components.assets
  ...
  prefetch={[concurrency: 3]}
/>
  • prefetch downloads them all at once
  • prefetch={[concurrency: 3]} downloads three at a time
  • prefetch={[event: "app:ready"]} waits for a custom window event instead of load

This PR also adds nonce to assets/1 as a separate commit, since it's useful on its own for a strict CSP.

@osbre
osbre marked this pull request as draft October 1, 2026 02:10
@osbre
osbre marked this pull request as ready for review October 1, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant