Skip to content

Move integrity support to the Static Web Assets SDK from the Blazor WebAssembly SDK #47000

Closed
@javiercn

Description

@javiercn

We do have a set of features for dealing with hashes ("integrity") on Blazor files as well as for applying fingerprints to files, we should move those to static web assets.

  • We will add two new properties to the definition of a static web asset "Fingerprint" and "Integrity".
    • Fingerprint is the Base36 encoding of the integrity hash that can be used to uniquely fingerprint the file.
    • Integrity will be the Base64 encoding of the SHA256 hash, which is what we currently put in the blazor.boot.json manifest.
  • We will update DefineStaticWebAssets to automatically compute the fingerprint and hash for the assets being defined.
    • The way I envision this working is via "token" replacements. We can support defining tokens in the file name, like asset.[Fingerprint].razor.js.
    • When we are constructing the asset relative path, we replace the [Fingerprint] bit with the actual computed fingerprint of the asset, which is stored in item metadata for the item.
    • We make comparisons based on the relative path and other aspects, so we might need a property separate from the relative path (RelativePathTemplate) or similar to make it easier to work.

Metadata

Metadata

Assignees

Labels

Pillar: Technical DebtPriority:1Work that is critical for the release, but we could probably ship withoutarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-razor-sdk

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions