refactor(assets)!: replace AssetLoaderTrait with AssetLoader class#705
Merged
aryanjasala merged 2 commits intoJun 4, 2026
Merged
Conversation
Convert the asset-loading mixin into a concrete, injectable class so it has an instance identity that can be passed around and shared.
There was a problem hiding this comment.
Pull request overview
Migrates the theme’s Assets loader implementation from the framework’s former AssetLoaderTrait mixin to the new concrete rtCamp\WPFramework\AssetLoader base class, keeping the theme’s asset registration/enqueue hooks in place while aligning with the framework’s updated API.
Changes:
- Replaces
use AssetLoaderTraitwithextends AssetLoaderin the themeAssetsclass. - Updates the constructor to delegate base path/URL/assets directory initialization to
AssetLoader::__construct(...). - Adds/expands class-level documentation to reflect the new inheritance-based design.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Refresh composer.lock: rtcamp/wp-framework dev-main e3d6522 → b947582, the main tip that now carries the AssetLoader class. The full update also advances the phpstan and wp-cli dev refs.
pratik-londhe4
approved these changes
Jun 4, 2026
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.
What this does
Migrates the theme's
Assetsclass onto the framework's new concreteAssetLoader. The asset loader is now an object the theme extends ratherthan a trait it mixes in. No behaviour change — the same scripts/styles register
on the same hooks.
Changes
inc/Core/Assets.php:use AssetLoaderTrait→extends AssetLoader;constructor now calls
parent::__construct( ELEMENTARY_THEME_PATH, get_template_directory_uri(), 'assets/build' ).Breaking change / dependency
Requires
rtcamp/wp-frameworkwithAssetLoader(the trait has been removed).Depends on rtCamp/wp-framework#34 — merge that first, then this resolves on
dev-main.How I verified
AssetLoader).