Read and resolve entrypoints.json in RepriseBundle#15
Merged
Conversation
1b9a3b9 to
98d73f8
Compare
Kocal
commented
Jul 11, 2026
98d73f8 to
4216388
Compare
First slice of the PHP consumer bundle -- the read foundation: - Value objects for the self-describing entrypoints.json (Entrypoints, Entry, DevServer) with validating fromArray() factories. - EntrypointsLookup (+ interface): resolves an entry's js/css/preload/dynamic URLs, deduplicates a chunk shared by several entries within one request, exposes the integrity map and the build mode, and supports strict / non-strict lookups. - ResetAssetsEventListener clears the per-request dedup state when the main request finishes (long-running workers). - Bundle config (output_path, strict_mode) + service wiring; the interface is autowirable so user code can inject it (e.g. rendering several times / PDF). Also record ADR 0001 (doc/adr/): asset URLs will be resolved through symfony/asset Packages at render time (base_path + base_urls), which the TagRenderer slice builds on. Rendering (Twig tags, the render event, dev-server client injection) and WebLink preload land in the next slices.
4216388 to
e51b165
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.
This is the read foundation of
RepriseBundle(until now an empty stub): it reads and resolves theentrypoints.jsonthe JS plugin emits. No rendering yet -- Twig tags and preload are separate slices coming later.Adds:
entrypoints.json(Entrypoints,Entry,DevServer) with validatingfromArray()factories. Malformed input is rejected with a clearInvalidEntrypointsException.EntrypointsLookup(behindEntrypointsLookupInterface): resolves an entry's js/css/preload/dynamic URLs, deduplicates a chunk shared by several entries within one request (so a shared file isn't emitted twice on one page), exposes the integrity map and the build mode (isProd / dev server), and supports strict and non-strict lookups.ResetAssetsEventListener, which clears the per-request dedup state when the main request finishes. Needed for long-running workers like FrankenPHP or RoadRunner, where state would otherwise leak across requests.output_path,strict_mode) and service wiring. The interface is autowirable, so user code can inject it directly, for example to render an entry several times or for PDF generation, callingreset()between renders.Also records ADR 0001 (
doc/adr/0001-packages-driven-asset-urls.md): asset URLs will be resolved through Symfony's assetPackagesat render time (base_path + base_urls), mirroring Webpack Encore, rather than the JS plugin emitting final URLs. The upcoming tag-renderer slice builds on that decision, and it means the JS plugin'sentrypoints.jsonoutput format will change (relative hashed paths instead of resolved URLs). The reader added here isn't affected: it just returns whatever references the file holds.Testing: 32 tests, 100% line/method/class coverage on the new code. PHPStan max and PHP-CS-Fixer clean.