Skip to content

esbuild fingerprint detection broken #728

Open
@jarednorman

Description

@jarednorman

Expected behavior

According to its description, #718 was meant to make it so that esbuild's chunk hashing could be detected by sprockets to avoid adding a second fingerprint. All that should be required by the user is to add .digested to the chunk name to make it more detectable and avoid false positives.

Actual behavior

The assets are refingerprinted.

The pattern does not match the current fingerprinting used by esbuild. It changed from SHA1 to xxHash in this PR. The hashes that esbuild now generates are base32, uppercase, exactly 8 chars.

The pattern than detects the fingerprinting is /-([0-9a-f]{7,128})\.digested/. (link)

Here's an example of a build with a line highlighting showing a hashed asset receiving a fingerprint from Sprockets:

CleanShot 2021-12-13 at 14 08 35

System configuration

  • Sprockets version: master
  • Ruby version: 2.7.4p191
  • Rails version: 6.1.4.1

Example App (Reproduction)

Sorry, no reproduction app, but I'm totally happy to make a PR to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions