-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Disable hash for release builds #136
Comments
Thanks for reporting. Curious, is there a particular use-case you have for removing the hash? This functionality is also requested by #46 so I am not contesting its usefulness. |
It's more a nice to have. I plan to embed the generated files into an executable with |
@nalply as @philip-peterson said, thanks for the report. I would assert that hashing the content for release builds is actually what is MOST critical, because that is what will ensure that your users content is properly E-tagged (if using etags), and the old cached versions of files are not used because the hash in the file changes its identity with respect to the cache. So cache busting is definitely critical for production / release builds. That said, what you are looking for actually reminds me a bit of what we've discussed over in #9, namely the bits about generating a manifest of all objects which were output from the build. That would give you a mechanism for being able to programatically including the contents of the generated content without having to do anything hacky. Thoughts? |
@nalply definitely let me know if we need to open this issue again. |
Release builds aside, I have hit a case where building without hashes may be necessary for use with https://github.com/w3reality/wasm-mt/ . Their setup cites a first step as: use wasm_mt::prelude::*;
let pkg_js = "./pkg/exec.js"; // path to `wasm-bindgen`'s JS binding
let mt = WasmMt::new(pkg_js).and_init().await.unwrap(); In the case of trunk, the Thoughts? |
@fosskers well, that sounds like reason enough to add a CLI or Trunk.toml config option to disable hashing of filenames. This will be a rather simple feature to implement as the hashing of contents is pretty well encapsulated the plumbing for configuration is quite good. Let's do it. |
Thank you! |
Hashes are useful for cache busting, I grant that.
But for release builds they aren't really neccessary, or are they?
Would it make sense to disable hashes for release builds?
The text was updated successfully, but these errors were encountered: