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

+28 -6
View File
@@ -1,6 +1,6 @@
use const_serialize::SerializeConst;
use crate::AssetOptions;
use crate::{AssetOptions, AssetOptionsBuilder};
/// The builder for a folder asset.
#[derive(
@@ -19,18 +19,40 @@ pub struct FolderAssetOptions {}
impl Default for FolderAssetOptions {
fn default() -> Self {
Self::new()
Self::default()
}
}
impl FolderAssetOptions {
/// Create a new folder asset using the builder
pub const fn new() -> Self {
Self {}
/// Create a new folder asset builder
pub const fn new() -> AssetOptionsBuilder<FolderAssetOptions> {
AssetOptions::folder()
}
/// Create a default folder asset options
pub const fn default() -> Self {
Self {}
}
}
impl AssetOptions {
/// Create a new folder asset builder
///
/// ```rust
/// # use manganis::{asset, Asset, AssetOptions};
/// const _: Asset = asset!("/assets", AssetOptions::folder());
/// ```
pub const fn folder() -> AssetOptionsBuilder<FolderAssetOptions> {
AssetOptionsBuilder::variant(FolderAssetOptions::default())
}
}
impl AssetOptionsBuilder<FolderAssetOptions> {
/// Convert the options into options for a generic asset
pub const fn into_asset_options(self) -> AssetOptions {
AssetOptions::Folder(self)
AssetOptions {
add_hash: false,
variant: crate::AssetVariant::Folder(self.variant),
}
}
}