New resource loader#997
Merged
Merged
Conversation
| Q | A | --------------- | ----- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Related tickets | | License | MIT The idea of this collection is to have a collection of resource names (that will be class names inside, but I want it to be more generic if needed later). It will be used in a new resource loader (for Routing) which will be used instead of this [too much specific one](https://github.com/Sylius/SyliusResourceBundle/blob/1.13/src/Bundle/Routing/RoutesAttributesLoader.php). It will allow to create route collection for all resources that have new resource metadata. ```php # config/sylius/resources/speaker.php use App\Conference\Entity\Speaker; use Sylius\Resource\Metadata\Create; use Sylius\Resource\Metadata\Index; use Sylius\Resource\Metadata\Operations; use Sylius\Resource\Metadata\ResourceMetadata; return (new ResourceMetadata()) ->withRoutePrefix('/admin') ->withClass(Speaker::class) ->withSection('admin') ->withTemplatesDir('crud') ->withOperations(new Operations([ new Create(), new Index(), ])) ; ``` I've created a specific new-resource-loader branch to allow us to merge it quicky in a WIP mode.
Co-authored-by: Dmitri Perunov <diimpp@gmail.com>
| Q | A | --------------- | ----- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Related tickets | | License | MIT Based on #985
Co-authored-by: Dmitri Perunov <diimpp@gmail.com>
| Q | A | --------------- | ----- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Related tickets | | License | MIT
GSadee
reviewed
Mar 12, 2025
| </argument> | ||
| <argument>%kernel.environment%</argument> | ||
| <tag name="routing.loader" /> | ||
| <deprecated package="sylius/resource" version="1.13">The "%service_id%" service is deprecated since sylius/resource-bundle 1.13 and will be removed in sylius/resource-bundle 2.0. Use "sylius_resource.symfony.routing.loader.resource" instead.</deprecated> |
Member
There was a problem hiding this comment.
There is no such a service: sylius_resource.symfony.routing.loader.resource 🤔
Comment on lines
+27
to
+29
| /** | ||
| * @param array{paths: string[]} $mapping | ||
| */ |
Member
There was a problem hiding this comment.
It can be in one line, similar as other doc blocks
Comment on lines
+33
to
+35
| private OperationRouteFactoryInterface $operationRouteFactory, | ||
| private ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory, | ||
| private RegistryInterface $resourceRegistry, |
Member
Author
|
@GSadee thx for the review, I will fix that in one hour. This one is one of the most important for me to continue my work on external PHP file support. |
NoResponseMate
approved these changes
Mar 12, 2025
2549c7f to
efe57d1
Compare
Co-authored-by: Jan Góralski <jan.wojciech.goralski@gmail.com>
efe57d1 to
2fa38d2
Compare
GSadee
approved these changes
Mar 13, 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.
This work have ben reviewed via multiple PRs.
#985
#986
#987
It reworks the routing system to allow more routing system than the attributes one in the near future.