Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure compatibility with esbuilds' base32 digests #726

Merged
merged 1 commit into from
Jun 20, 2022

Conversation

dhh
Copy link
Member

@dhh dhh commented Nov 11, 2021

esbuild hashes using base32, so we can configure it to produce files like application-TQDC3LZV.digested.js, but we need the digest patterns to accept this. That requires changing the digest matching pattern from /-([0-9a-f]{7,128})\.[^.]+\z/ to /-([0-9a-zA-Z]{7,128})\.[^.]+\z/.

@strobilomyces
Copy link

Just curious if there's anything preventing this from being merged. Thank you.

@cirdes
Copy link

cirdes commented Mar 30, 2022

Sprockets is supporting webpack digest but we need this PR merged to support esbuilds too. Hope it could be merge!

@markets
Copy link

markets commented May 16, 2022

@rafaelfranca @dhh sorry for the ping 🙏🏼 but would be amazing to merge and release this one! Is there anything missing? It has already been merged on Propshaft: rails/propshaft#55.

Sorry again and thanks a lot for building & maintaining Rails 🙌🏼

@rafaelfranca rafaelfranca merged commit 894147f into master Jun 20, 2022
@ylecuyer
Copy link

I have an issue when running https://github.com/FabienChaynes/faye-authentication and another similar gem called faye-presence with this commit.

They have assets which are now matching the pattern and which get stripped out in the sprocket server. Any recommendation on how to get the assets being served with the changes in this PR?

@schneems
Copy link
Member

This caused a regression mentioned in this blog post https://evgeniydemin.medium.com/breaking-change-during-rails-upgrade-introduced-by-david-heinemeier-hansson-80262129c7f1

In the blog post anything-supercool.svg was being viewed by sprockets as already having a digest because of the change in the server regexp:

This causes sprockets to look for assets/anything-supercool.svg instead of doing a lookup for the digest in the manifest and looking for assets/anything-supercool-<digest>.svg

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.

7 participants