[Integrity] Emit Subresource Integrity hashes in entrypoints.json - #12
Merged
Conversation
Kocal
force-pushed
the
feat/subresource-integrity
branch
from
July 11, 2026 04:58
553c518 to
2a03a2f
Compare
Add an opt-in `integrity: { enabled, algorithms? }` option (default `['sha384']`)
that writes an `integrity` map (asset URL -> SRI hash) into entrypoints.json, for
Reprise's Symfony bundle (src/RepriseBundle.php, still a stub) to render as
integrity="..." on the script/link tags. This change is JS-only.
Hashes are computed from the files on disk after each bundler finishes emitting: the
Rspack `done` hook and a Vite `writeBundle` hook both read the emitted files back and
hash them. In-memory hashing does not work for Vite because it finalizes chunks (e.g.
replacing `__VITE_PRELOAD__`) only when writing to disk, so the shipped bytes differ
from the bundle. Every referenced file per entry (js/css/preload/dynamic) is covered.
Build only -- the dev server serves changing in-memory assets, so no hashes there.
Also correct the entrypoints/manifest consumer references to Reprise's own
RepriseBundle (not WebpackEncoreBundle) across AGENTS.md, README and docs, and
record the feature-name commit scope and the Vite/Rsbuild test-symmetry rule in
AGENTS.md.
Kocal
force-pushed
the
feat/subresource-integrity
branch
from
July 11, 2026 05:10
2a03a2f to
9f16080
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add an opt-in
integrity: { enabled, algorithms? }option (default['sha384'])that writes an
integritymap (asset URL -> SRI hash) into entrypoints.json, forReprise's Symfony bundle (src/RepriseBundle.php, still a stub) to render as
integrity="..." on the script/link tags. This change is JS-only.
Hashes are computed from the files on disk after each bundler finishes emitting: the
Rspack
donehook and a VitewriteBundlehook both read the emitted files back andhash them. In-memory hashing does not work for Vite because it finalizes chunks (e.g.
replacing
__VITE_PRELOAD__) only when writing to disk, so the shipped bytes differfrom the bundle. Every referenced file per entry (js/css/preload/dynamic) is covered.
Build only -- the dev server serves changing in-memory assets, so no hashes there.