Hashless assets (#4312)

* add support for external assets

* fix playwright tests

* add more documentation to with_hash_suffix

* restore external asset hashing tests

* Update gtk workflow dependencies

* fix doc test

* multiple versions of libgtk

* clear dx in playwright tests

* fix fullstack caching test

* try without apt cache

* cache everything except libxdo-dev

* revert ci changes

* fix wasm asset options

* fix merge conflict

* recommend the used attribute instead

* Move options to AssetOptionsBuilder

* Don't deprecate non-canonical new asset options functions

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
Evan AlmloffandJonathan Kelley authored and GitHub committed 2025-06-30 19:21:49 -07:00
1 parent 0bd376b873
commit e74c838441
22 files changed
+569 -316

No files matched your search

@@ -35,7 +35,7 @@ impl Parse for AssetParser {
// ```
// asset!(
// "/assets/myfile.png",
// ImageAssetOptions::new()
// AssetOptions::image()
// .format(ImageFormat::Jpg)
// .size(512, 512)
// )
@@ -84,8 +84,9 @@ impl ToTokens for AssetParser {
asset_string.hash(&mut hash);
let asset_hash = format!("{:016x}", hash.finish());
// Generate the link section for the asset
// The link section includes the source path and the output path of the asset
// Generate the link section for the asset. The link section includes the source path and the
// output path of the asset. We force the asset to be included in the binary even if it is unused
// if the asset is unhashed
let link_section = crate::generate_link_section(quote!(__ASSET), &asset_hash);
// generate the asset::new method to deprecate the `./assets/blah.css` syntax
@@ -96,7 +97,7 @@ impl ToTokens for AssetParser {
};
let options = if self.options.is_empty() {
quote! { manganis::AssetOptions::Unknown }
quote! { manganis::AssetOptions::builder() }
} else {
self.options.clone()
};