New "extend asset" feature - #63
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #63 +/- ##
============================================
- Coverage 87.55% 86.50% -1.06%
- Complexity 293 310 +17
============================================
Files 26 27 +1
Lines 860 882 +22
============================================
+ Hits 753 763 +10
- Misses 107 119 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cristianobaptista
approved these changes
Oct 29, 2025
cristianobaptista
left a comment
There was a problem hiding this comment.
LGTM after latest changes👍
dottxado
approved these changes
Oct 29, 2025
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.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Currently, when using a Loader like the
Inpsyde\Assets\Loader\WebpackManifestLoader, it is not possible to easily extend the Asset with additional data like "enqueue".The following new methods were added the the
Inpsyde\Assets\AssetManager:AssetManager::extendAsset()- allows to extend the Asset with additional data before it is processed.AssetManager::isAssetProcessed()- TheAssetManagernow keeps track of assets that are processed.Considering we have the following
manifest.json:{ "script.js": "/public/path/script.23dafsf2138d.js", "style.css": "style.23dafsf2138d.css" }What is the current behavior? (You can also link to an open issue here)
To extend the Assets loaded from the
manifest.jsonwe would need to do the following right now:What is the new behavior (if this is a feature change)?
The new approach will look like the following:
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No.
Other information
This PR will also contain the following changes:
AssetManager::$assetsis now anInpsyde\Assets\AssetCollectioninstead ofSplObjectStorage