Resources and standalone components #59
Merged
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.
Introducing Resources as a way to provide information about a component.
Paving the way for components to be independent from enums (lists), and either provide their own resource information, or for implementations (like the Drupal module), to specify default resource information.
All of the requirements of
ObjectListInterfacemoved to the new resource interface, leavingObjectListInterfacea combination of the resource interface and enum interfaces.Enum and enum class/lists are abstracted, and are no longer a part of the runtime API.
The two static methods of
ObjectListInterface,librariesanddefinitions, are removed have no replacement. Libraries are mostly a Drupal concept, collates CSS and JS assets and resolve dependencies. This responsibility has moved to the Drupal module. Utilities for these have also been removed. The role ofdefinitionshas been moved to discovery and thePintoMappingclass, which was previously a duplicated requirement.A new method has been added to
ResourceInterface::dependencies, required byObjectListInterface. This method has a default implementation which reflectsDependencyOnenums.A new method has been added to
ResourceInterface::getClass, required byObjectListInterface. This method has a default implementation which reflectsDefinitionenums. Enums cases which do not have an associated component class will returnNULL.Most regular uses of the Pinto libraries will not require changes. Projects making use of Pinto, adding automation and other conveniences, will likely need minor updates.
Anything previously typehinted on
ObjectListInterfacewill likely change toResourceInterfaceThe signature of
PintoMapping::__constructhas been modified, parameters need to be populated appropriately.PintoMapping::getByClasshas been replaced withPintoMapping::getResourcePintoMapping::getEnumClasseshas been removed, a similar solution is introduced atPintoMapping::getResources.