Skip to content

Frontend Optimizer

This page is generated from public package documentation in capell-4/packages and the package manifest checked into the source repository.

FieldValue
Composer packagecapell-app/frontend-optimizer
Package slugfrontend-optimizer
Product groupCapell Foundation
Tierpremium
Bundlefoundation
Runtime contextsadmin, frontend
Capell version^4.0
Source repositorycapell-app/packages
Source pathpackages/frontend-optimizer
Docs sourcepackages/frontend-optimizer/docs
Manifestcapell.json

Profile-based CSS and JavaScript delivery for public Capell pages.

  • Package: capell-app/frontend-optimizer
  • Namespace: Capell\FrontendOptimizer\
  • Surfaces: frontend Blade directive, queue, database
  • Service providers: packages/frontend-optimizer/src/Providers/FrontendOptimizerServiceProvider.php
  • Capell dependencies: capell-app/core, capell-app/frontend
  • Third-party dependencies: lorisleiva/laravel-actions, spatie/laravel-data, spatie/laravel-package-tools, symfony/process
  • Provides profile-based CSS and JavaScript delivery so Capell frontend performance can improve without rewriting themes.
  • Helps owners keep pages lean as optional packages add assets, widgets, and render profiles.
  • Gives developers manifest, critical CSS, and render-profile surfaces for package-aware asset loading.
  • Profile-based CSS and JavaScript delivery for public Capell pages.
  • @frontendOptimizerAssets(...) Blade directive for rendering resolved profile assets.
  • Render profile storage and critical CSS generation support.
  • No direct Filament admin surface or public route.
AreaPathPurpose
Actionspackages/frontend-optimizer/src/ActionsDomain operations. Test these directly where possible.
Datapackages/frontend-optimizer/src/DataStructured payloads, form state, view models, and integration data.
Enumspackages/frontend-optimizer/src/EnumsPersisted states and Filament option values.
Modelspackages/frontend-optimizer/src/ModelsEloquent records owned by the package.
Jobspackages/frontend-optimizer/src/JobsQueued work and async side effects.
Providerspackages/frontend-optimizer/src/ProvidersRegistration, extension hooks, routes, migrations, and resources.
Resourcespackages/frontend-optimizer/resourcesViews, translations, assets, and package resources.
Configpackages/frontend-optimizer/configPackage configuration and publishable config.
Databasepackages/frontend-optimizer/databaseMigrations, seeders, and settings migrations.
Testspackages/frontend-optimizer/testsPackage-level Pest coverage.
  • Blade directive: @frontendOptimizerAssets(...).
  • Jobs: GenerateCriticalCssJob.
  • Critical CSS generation uses the configured process runner; keep failures visible in optimization run records rather than hiding them in Blade output.
  • Models: FrontendOptimizationRun, FrontendRenderProfile.
  • Migrations: 2026_05_10_190851_01_create_frontend_optimizer_tables.php.
  • Config: packages/frontend-optimizer/config/capell-frontend-optimizer.php.
  • Data objects live in src/Data/; use them for payloads, form state, and view models.
  • Contracts: CriticalCssGenerator.
  • Register Capell extension points, routes, migrations, settings, render hooks, and resources from service providers.
  • Install with composer require capell-app/frontend-optimizer in the host Capell application.
  • Run migrations through the host application package install flow.
  • In this repository, verify package changes with vendor/bin/pest; do not use php artisan.

Run package tests from the repository root:

Terminal window
vendor/bin/pest packages/frontend-optimizer/tests --configuration=phpunit.xml
  • Put behaviour changes in src/Actions/; UI classes, commands, and controllers should call actions instead of owning domain logic.
  • Use package Data classes at boundaries instead of passing anonymous arrays between layers.
  • Use backed enums for persisted values and enum labels for Filament options.