Skip to main content

Capell uses essential storage for sessions, security, and interface preferences. Analytics and marketing storage stay off unless you accept them.

Cookie Policy
Frontend Optimizer marketplace hero artwork.

Frontend Optimizer

Faster first paint for public Capell pages: automatic above-the-fold critical CSS extracted from your real rendered pages, plus smart deferring of non-critical CSS and JavaScript.

Overview

What Frontend Optimizer provides

Faster first paint for public Capell pages: automatic above-the-fold critical CSS extracted from your real rendered pages, plus smart deferring of non-critical CSS and JavaScript.

It is built for teams that need frontend optimizer, performance, assets and critical css across filament admin without turning the project into one-off application code.

Editors get a focused Capell workflow that feels native to the site instead of another disconnected tool to learn.

Developers keep the behaviour inside a reviewed package boundary, with clear install impact, support context, and upgrade expectations.

Use the documentation tab, screenshot gallery, and related extensions on this page to decide how Frontend Optimizer fits before enabling it on a production Capell site.

/ 06
6 captures Visual gallery
Install

Install on your Capell site in three steps.

Each extension ships as a standard Composer package. Purchases unlock account access immediately before you install.

Support
First-party Capell support for active marketplace customers.
Data access
Uses package-local configuration and Capell metadata needed to enable the feature.
  1. 01

    Require the package

    composer require capell-app/frontend-optimizer
  2. 02

    Register the extension

    php artisan capell:extension:enable capell-app-frontend-optimizer
  3. 03

    Clear schema cache

    php artisan capell:admin:clear-schemas-cache
Works well with this

Related extensions

Browse the packages that usually pair with Frontend Optimizer or buy the suite it belongs to.

Package README Install impact, package shape, common pitfalls, and maintenance notes. Open

Frontend Optimizer

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

At A Glance

  • 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

Why It Helps Your Capell Workflow

  • 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.

Best Used With

What It Adds

  • 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.

Code Map

Area Path Purpose
Actions packages/frontend-optimizer/src/Actions Domain operations. Test these directly where possible.
Data packages/frontend-optimizer/src/Data Structured payloads, form state, view models, and integration data.
Enums packages/frontend-optimizer/src/Enums Persisted states and Filament option values.
Models packages/frontend-optimizer/src/Models Eloquent records owned by the package.
Jobs packages/frontend-optimizer/src/Jobs Queued work and async side effects.
Providers packages/frontend-optimizer/src/Providers Registration, extension hooks, routes, migrations, and resources.
Resources packages/frontend-optimizer/resources Views, translations, assets, and package resources.
Config packages/frontend-optimizer/config Package configuration and publishable config.
Database packages/frontend-optimizer/database Migrations, seeders, and settings migrations.
Tests packages/frontend-optimizer/tests Package-level Pest coverage.

Runtime Surface

  • 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.

Data And Persistence

  • 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.

Extension Points

  • Contracts: CriticalCssGenerator.
  • Register Capell extension points, routes, migrations, settings, render hooks, and resources from service providers.

Install And Setup

  • 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.

Docs

Testing

Run package tests from the repository root:

vendor/bin/pest packages/frontend-optimizer/tests --configuration=phpunit.xml

Maintenance Notes

  • 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.
Overview A shorter package overview for marketplace and account review. Open

Frontend Optimizer Overview

Frontend Optimizer records render profiles for public Capell pages and renders profile-aware CSS and JavaScript assets through the @frontendOptimizerAssets(...) Blade directive.

Use it when a site needs deterministic asset delivery per layout, widget set, site, locale, or theme context without hard-coding frontend bundles into theme views.

What It Adds

  • @frontendOptimizerAssets(...) for rendering the resolved asset profile.
  • Critical CSS generation through CriticalCssGenerator, backed by Playwright by default.
  • Extension settings for viewports, fold depth, generation behavior, and inline-size limits.
  • A page type opt-out for pages that should not run above-the-fold CSS generation.
  • Render profile actions for resolving, preparing, persisting, and storing profile manifests.
  • frontend_render_profiles and frontend_optimization_runs tables.

Install Impact

  • Requires capell-app/core and capell-app/frontend.
  • Adds one migration file that creates render profile and optimization run storage.
  • Registers extension settings and a page type configurator for critical CSS controls.
  • Frontend output is visible only where a theme or frontend view calls the Blade directive.

Admin Surfaces

  • Extension settings are registered through FrontendOptimizerSettings and FrontendOptimizerSettingsSchema.
  • Page type critical CSS opt-out is registered through FrontendOptimizerPageTypeConfigurator.

Frontend Surfaces

Surface Use case Screenshot
Blade directive output Verify that the active render profile emits the expected asset tags for a public page. frontend-optimizer-profile-assets
Critical CSS run artifact Verify generated critical CSS and manifest metadata for a seeded page profile. frontend-optimizer-critical-css-output

Demo Setup

Install the core baseline plus capell-app/frontend-optimizer, run migrations through the host app, seed or render at least one public page, then capture the public page HTML around the @frontendOptimizerAssets(...) output. A useful screenshot requires a theme fixture that actually calls the directive.

Screenshot Coverage

The package needs screenshot coverage for asset output, not for admin navigation. Captures should include the public page and enough response/source inspection to prove the expected profile assets were emitted.

The screenshot runner contract is defined in screenshots.json. The two required captures and their dark-mode variants are committed under docs/screenshots/, but they are not promoted in capell.json marketplace media until they show optimizer-specific profile asset and critical CSS output.

Known Risks

  • Empty screenshots are likely unless the demo theme calls the directive.
  • Playwright-backed critical CSS generation depends on the host runtime and browser availability.
  • Asset profile keys vary by render context; demo data should state the site, locale, layout, and theme used for capture.
  • Critical CSS generation should use a representative public URL for the profile; using an unusual page for a shared layout can produce a less useful above-the-fold subset.
  • Critical CSS generation completion invalidates through the frontend cache registry without importing HTML Cache internals. The invalidation is intentionally broad today because render profiles do not record exact cached URL coverage.

Related Guides

Verification

Run package tests from the repository root:

vendor/bin/pest packages/frontend-optimizer/tests --configuration=phpunit.xml
History

Downloads and releases

Total downloads
0
Last downloaded
No downloads yet

Version history

1 release
  1. v1.0.0
    May 3, 2026
Write a review

Write your comment here. If you are not logged in, you will be asked to log in or create an account before it can be submitted.

Login or create an account is required before the review is saved.

No approved reviews yet. Reviews from eligible customers appear here after marketplace review.

Payment and licences

How marketplace purchases work

Capell keeps payment, account ownership, package receipts, and install access separate so a failed step can be recovered without guessing where the licence lives.

Who takes the payment?

Paid marketplace checkouts are sent to Stripe. Capell does not collect card details inside your CMS; Stripe confirms the payment and Capell activates the matching marketplace licence for the Capell account that approved the install.

How is the licence attached?

The licence is created against the signed-in Capell account first. When the hosted install flow returns to your CMS, Capell binds that licence to the requesting site and sends back the install authorization needed to continue.

Where does Anystack fit?

Anystack can be the package commerce and distribution surface for marketplace products. Capell still records the account licence and installed receipt, then relays later Anystack product or licence events only to connected sites that already have the package installed.

What happens if checkout is cancelled or expires?

No licence is created until Stripe confirms payment. If checkout is cancelled, start it again from the same review screen. If the quote expires, return to the marketplace in your CMS and start a fresh install flow so pricing and package metadata are recalculated.

What should I do if something looks wrong?

Keep the support reference shown on the review screen or receipt, then contact support before retrying with a different account. For missing licences, failed returns, or Anystack receipt mismatches, Capell can reconcile the Stripe session, Capell account, package receipt, and connected site from that reference.