feat: CI/CD pipeline setup complete - Ansible playbooks updated, secrets configured, workflow ready
This commit is contained in:
@@ -17,6 +17,7 @@ use App\Framework\LiveComponents\Exceptions\RateLimitExceededException;
|
||||
use App\Framework\LiveComponents\Exceptions\StateValidationException;
|
||||
use App\Framework\LiveComponents\Exceptions\UnauthorizedActionException;
|
||||
use App\Framework\LiveComponents\ParameterBinding\ParameterBinder;
|
||||
use App\Framework\LiveComponents\Persistence\LiveComponentStatePersistence;
|
||||
use App\Framework\LiveComponents\Security\ActionAuthorizationChecker;
|
||||
use App\Framework\LiveComponents\Services\LiveComponentRateLimiter;
|
||||
use App\Framework\LiveComponents\Validation\DefaultStateValidator;
|
||||
@@ -31,6 +32,7 @@ use App\Framework\LiveComponents\ValueObjects\LiveComponentState;
|
||||
use App\Framework\LiveComponents\ValueObjects\ReservedActionName;
|
||||
use App\Framework\Performance\NestedPerformanceTracker;
|
||||
use App\Framework\Performance\PerformanceCategory;
|
||||
use App\Framework\StateManagement\SerializableState;
|
||||
|
||||
/**
|
||||
* Handles LiveComponent action execution and state updates
|
||||
@@ -60,7 +62,8 @@ final readonly class LiveComponentHandler
|
||||
private IdempotencyService $idempotency,
|
||||
private ParameterBinder $parameterBinder,
|
||||
private EventDispatcherInterface $frameworkEventDispatcher,
|
||||
private NestedPerformanceTracker $performanceTracker
|
||||
private NestedPerformanceTracker $performanceTracker,
|
||||
private ?LiveComponentStatePersistence $statePersistence = null,
|
||||
) {
|
||||
$this->stateValidator = new DefaultStateValidator();
|
||||
}
|
||||
@@ -216,10 +219,20 @@ final readonly class LiveComponentHandler
|
||||
['component' => $component->id->name]
|
||||
);
|
||||
|
||||
// 9. Convert State VO to array for serialization
|
||||
// 9. Persist state to database with optional history tracking
|
||||
if ($this->statePersistence !== null && $stateObject instanceof SerializableState) {
|
||||
$this->performanceTracker->measure(
|
||||
"livecomponent.state.persist",
|
||||
PerformanceCategory::DATABASE,
|
||||
fn() => $this->statePersistence->persistState($component, $stateObject, $method),
|
||||
['component' => $component->id->name, 'action' => $method]
|
||||
);
|
||||
}
|
||||
|
||||
// 10. Convert State VO to array for serialization
|
||||
$stateArray = $stateObject->toArray();
|
||||
|
||||
// 10. Build ComponentUpdate
|
||||
// 11. Build ComponentUpdate
|
||||
// The LiveComponentController will render HTML using ComponentRegistry
|
||||
$componentUpdate = new ComponentUpdate(
|
||||
html: '', // Will be populated by controller
|
||||
@@ -231,7 +244,7 @@ final readonly class LiveComponentHandler
|
||||
)
|
||||
);
|
||||
|
||||
// 11. Dispatch domain event for SSE broadcasting
|
||||
// 12. Dispatch domain event for SSE broadcasting
|
||||
// This enables real-time updates via Server-Sent Events
|
||||
$this->frameworkEventDispatcher->dispatch(
|
||||
new ComponentUpdatedEvent(
|
||||
@@ -328,10 +341,15 @@ final readonly class LiveComponentHandler
|
||||
// 6. Call onUpdate() lifecycle hook if component implements LifecycleAware
|
||||
$this->callUpdateHook($component, $stateObject);
|
||||
|
||||
// 7. Convert State VO to array
|
||||
// 7. Persist state to database with optional history tracking
|
||||
if ($this->statePersistence !== null && $stateObject instanceof SerializableState) {
|
||||
$this->statePersistence->persistState($component, $stateObject, 'handleUpload');
|
||||
}
|
||||
|
||||
// 8. Convert State VO to array
|
||||
$stateArray = $stateObject->toArray();
|
||||
|
||||
// 8. Build ComponentUpdate
|
||||
// 9. Build ComponentUpdate
|
||||
$componentUpdate = new ComponentUpdate(
|
||||
html: '', // Will be populated by controller
|
||||
events: $events,
|
||||
@@ -342,7 +360,7 @@ final readonly class LiveComponentHandler
|
||||
)
|
||||
);
|
||||
|
||||
// 9. Dispatch domain event for SSE broadcasting
|
||||
// 10. Dispatch domain event for SSE broadcasting
|
||||
$this->frameworkEventDispatcher->dispatch(
|
||||
new ComponentUpdatedEvent(
|
||||
componentId: $componentId,
|
||||
|
||||
Reference in New Issue
Block a user