Skip to content

fix(cli): make asset preloads deterministic and orderable - #5817

Open
Ddystopia wants to merge 1 commit into
DioxusLabs:mainfrom
Ddystopia:fix-asset-order
Open

fix(cli): make asset preloads deterministic and orderable#5817
Ddystopia wants to merge 1 commit into
DioxusLabs:mainfrom
Ddystopia:fix-asset-order

Conversation

@Ddystopia

Copy link
Copy Markdown

The manifest groups assets in hash sets, whose iteration order changes from run to run, so the generated index.html differed between builds of an unchanged app and defeated caching. AppManifest::unique_assets and get_first_asset_for_source now walk the manifest in an explicit order (bundled path, then source path).

Preload tags also get two new knobs. with_fetch_priority sets the fetchpriority attribute of the generated <link rel="preload">, and with_preload_order places a tag among the other preloads. Every preload now flows through one ordered list that is rendered ahead of the rest of the head, so a resource the first render waits on can be discovered before the render blocking styles and scripts.

Closes #4439

The manifest groups assets in hash sets, whose iteration order changes
from run to run, so the generated index.html differed between builds of
an unchanged app and defeated caching. `AppManifest::unique_assets` and
`get_first_asset_for_source` now walk the manifest in an explicit order
(bundled path, then source path).

Preload tags also get two new knobs. `with_fetch_priority` sets the
`fetchpriority` attribute of the generated `<link rel="preload">`, and
`with_preload_order` places a tag among the other preloads. Every
preload now flows through one ordered list that is rendered ahead of
the rest of the head, so a resource the first render waits on can be
discovered before the render blocking styles and scripts.

Closes DioxusLabs#4439
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.

Underterministic Asset Management + Bad Priority Management

1 participant