feat: use calculated integrity hashes for local vendor plugins#947
feat: use calculated integrity hashes for local vendor plugins#947pivaldi wants to merge 0 commit into
Conversation
|
This pull request contains changes to the configuration file. Please make sure the documentation in NexT website is changed or added. |
|
@pivaldi I checked all dependencies from Could you clarify in which scenario the current hardcoded integrity values fail for |
|
Thanks for taking a look, @stevenjoezhang — and you're right to push on this. the hardcoded hash actually fail only when the vendor files served in The mismatch shows up once the bundled vendor versions diverge from the pinned hashes. In my case that happens because I let Renovate update the libraries inside There is a simpler fix than this PR… If you'd rather keep SRI even for local assets, the computed-hash approach in this PR (#347 exposing My preference would be to "drop integrity for local" route since it's smaller and needs no plugin release. One more thing: we can split the lazy-CSS optimization out into its own PR so it can be reviewed independently of the SRI discussion. |
|
@pivaldi Thanks for clarifying. I agree that dropping So I would prefer:
Thanks! |
|
Closing this in favor of two focused PRs that address @stevenjoezhang's feedback. As discussed above, hardcoded SRI hashes only break when self-hosted vendor Splitting the original change into:
Thanks for the review! |
PR Type
When
vendors.pluginsis set tolocal, integrity hashes are now computed from the actual local files via@next-theme/pluginsgetLocalIntegrity()rather than using the hardcoded CDN hashes from_vendors.yml.This fixes SRI (Subresource Integrity) validation failures that caused browsers to block all vendor assets when self-hosting, resulting in blank pages.
CDN mode is unaffected: hardcoded hashes from
_vendors.ymlare still used whenpluginsis notlocal.Depends on: next-theme/plugins#347