artisanpack-ui/performance
ArtisanPack UI Performance gives Laravel developers a focused toolkit for measuring, monitoring, and improving application performance, integrating cleanly with the ArtisanPack UI ecosystem.
Architecture fit
v1.1.0 keeps the package's existing shape — service-provider self-registration, feature-keyed agents, and an HTTP surface — and extends it rather than restructuring it, so hosts already running the performance package will recognize the patterns. The two agents (performance.query_insight, performance.optimization_suggestion) follow the aiFeatures() auto-discovery convention from artisanpack-ui/ai, which means no manual wiring in the host's provider. Three parallel trigger surfaces (Livewire, React, Vue) cover the realistic Laravel front-end topologies: Blade/Livewire apps get an out-of-the-box panel, while SPA hosts get components that accept caller-supplied data. The decision to ship React/Vue components inside the performance package rather than in the shared @artisanpack-ui/react / @artisanpack-ui/vue bundles is defensible for coupling reasons but fragments the JS distribution model the team already knows.
The concerning architectural change is the promotion of artisanpack-ui/ai from optional to a hard require. That converts an additive feature release into a dependency the entire installed base inherits, whether or not they enable AI. For a performance-observability package this is a heavier footprint than the feature justifies, and it is the single item most likely to complicate upgrades.
Integration feasibility
Feasible but non-trivial. Work required in the host: aligning on artisanpack-ui/ai: ^1.0, publishing/overriding ai_middleware (default ['api', 'auth:sanctum']), deciding whether the default permissive performance.ai.use Gate is acceptable, and configuring model credentials. The 409/412/422/404/403 status taxonomy plus the PerformanceAiError class with status and feature key is genuinely good integration ergonomics — misconfiguration surfaces as a renderable state rather than a parse-the-message exercise. The Livewire OptimizationSuggestionPanel reading performance_metrics directly with MAX_WINDOW_DAYS = 90 / MAX_METRICS_ROWS = 2000 means a working demo in minutes; the React/Vue paths require the host to own metric aggregation, which is more work than the release notes imply.
Technical risk
$cacheable = false. The rationale is sound for a point-in-time diagnostic, but it means every panel render is a full-price model call. Combined with a permissive default Gate (any authenticated user), the package ships a token-burn path with no built-in quota.claude-sonnet-4-6 as default model is fine if configurable; the release notes don't state how the host overrides it.Key questions
artisanpack-ui/ai be made a suggest rather than a hard require, or is the coupling intentional and permanent?performance.ai.use Gate, or is that entirely the host's problem?Stack fit
Assumes Laravel with Sanctum already in play (the default ai_middleware depends on auth:sanctum, and the gate assumes an authenticated user). Livewire hosts get the lowest-friction path — component plus direct metrics read, no aggregation code. Inertia/React and Inertia/Vue hosts get components that expect a caller-supplied metrics batch, which means the host must already have, or build, an aggregation step against performance_metrics. Vanilla JS and any other caller can use PerformanceClient.suggestQueryInsight() / suggestOptimization(). The separately-configured ai_middleware correctly avoids reusing the anonymous Web Vitals ingest stack — that separation is the right call and should be preserved as-is.
Migration path
This is an additive minor release, but the artisanpack-ui/ai require promotion makes it an upgrade that must be planned, not floated. Sequence:
artisanpack-ui/ai version against whatever the host already pulls; check for conflicts in a branch, not on the integration environment.composer update artisanpack-ui/performance and verify the AI package boots cleanly even with AI features off.ai_middleware config; confirm route registration does not collide with existing /api/performance/* routes.performance.ai.use Gate override behavior — the guard is designed so a host-registered override wins, so register one explicitly rather than relying on the permissive default.412 path deliberately (unset the key, confirm the client surfaces it).PerformanceClient before touching any UI components.Compatibility
Watch items: config caching (php artisan config:cache) after adding ai_middleware; CSRF/cookie vs token auth depending on whether React/Vue callers are same-origin SPA or external; and the shipped React/Vue components' bundler expectations, which now live in a PHP-vendored package and therefore sit outside the normal JS dependency graph — verify they resolve through the host's build. Livewire component registration should be automatic via the service provider but is worth a route/list check.
Sequencing Land the dependency and config work first and independently of feature enablement, so a failed upgrade is isolated. Then enable the API surface behind a restrictive Gate, then the Livewire panel (lowest effort, highest signal for validating cost and latency), then React/Vue once the host owns metrics aggregation. Ship the query-insight panel before the optimization panel: it is the more clearly valuable feature and the easier one to evaluate against a human DBA's read.
Maintenance
Two new agent classes plus three trigger surfaces across two JS frameworks inside a PHP package is a meaningful maintenance surface expansion — the team is now tracking prompt/model behavior, not just code. The default model string claude-sonnet-4-6 is pinned in code and will drift; confirm it is config-overridable so model rotation doesn't require a package bump. Upstream artisanpack-ui/ai semver becomes an upgrade gate for the performance package whether or not AI is in use. Budget recurring review time for the dual-framework components.
Support
The error taxonomy is the strongest operational asset in this release: 409 disabled, 412 missing credentials, 422 validation, 404 unknown feature, 403 gate denial, all carried through PerformanceAiError with the feature key. First-line support can triage from a status code without reading logs. Gaps to document internally: no stated behavior for provider timeouts or 5xx, and no user-facing distinction between "gate denied" and "quota exhausted" — both will look like 403 unless the host layers a quota signal on top.
Scaling
Model latency, not throughput, will set the UX ceiling; panels should be treated as slow operations and be user-initiated rather than rendered on page load. $cacheable = false on both agents means repeated identical diagnoses cost full price every time — worth a host-side dedupe or short-TTL cache keyed on query+plan hash if panels get heavy use. The MAX_WINDOW_DAYS = 90 / MAX_METRICS_ROWS = 2000 bounds are a good defensive default and cap input size, but they cap input, not call volume. The empty-metrics short-circuit correctly avoids a model call for a nil result — good. Concurrency should be assumed to hit the model provider's rate limits before it hits anything in the Laravel app.
Failure modes
412, explicit and renderable (good).409, explicit (good).Ramp-up
Lowest-effort adoption is Livewire + API only, with AI gated to a pilot group; that path needs little beyond composer and credential config. React/Vue adoption adds front-end build work and host-owned metrics aggregation and should be treated as a second phase. The team will need working familiarity with LLM cost controls, credential management, and prompt/agent behavior — this is a new competency for most Laravel teams and should be assigned to someone explicitly rather than absorbed tacitly. Recommend a two-week pilot with a restrictive Gate, cost logging on both agents, and a documented rollback: revert to the prior package version and disable the two feature keys, which the gate and 409 path make clean.
How can I help you explore Laravel packages today?