Repository navigation
refactor: give the asset classes that will leave the framework their dependencies - #485
Merged
Merged
Conversation
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.
Step 1 of pollora/assets (plan: .claude/plans/assets-package.md): the classes that will move into the package no longer reach for Laravel.
What changed
Asset/Domain/Contracts:ViteManagerFactory(builds the Vite resolver of a container),RuntimeContext(command line or not),PublicPath.Asset/Infrastructure/Laravel/(they stay in the framework):LaravelViteManagerFactory,LaravelRuntimeContext,LaravelPublicPath,LaravelAssetFileResolver.AssetEnqueuer: takesAssetManager,Action,Filter, the factory, the runtime and a PSR-3 logger instead ofApplication,resolve(),Logandnew ViteManager. Its enqueue still happens in__destruct.AssetFile: a static resolver (AssetFile::resolveUsing()) set by the provider, since it is built withnewwherever a theme names a file.AssetManager: gets aPublicPath(default hot file of a container without one) and an enqueuer factory.AssetContainer,MissingBuilds(PSR-3) andMissingBuildNotice(project root passed in) no longer callpublic_path(),Logorbase_path().AssetServiceProviderbinds all of it.ViteManager(Laravel's Vite) andRootAssetManagerare untouched and stay in the framework.How it was checked
useVite()asks the factory for the resolver, and says so when none is set).instanceof ViteManagerreplace had turned my owninstanceof ViteManagerFactoryinto a class that does not exist: everyuseVite()threw, 500 on the whole site).AssetEnqueuerTest(RuntimeContext),ViteManagerTest(MissingBuildNoticewith the project root), and the contract test (AssetFileresolver and factory).Known and unrelated:
AssetEnqueuerTestrun alone ends with a fatal at shutdown (destructors after the container is gone), the same on the base.