Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Blade Boost Directive Laravel Package

angus-mcritchie/blade-boost-directive

Adds a simple @boost Blade directive to Laravel apps, enabling browser prefetching and prerendering of linked pages so navigation feels instant. Configure which links to boost and improve perceived performance with minimal code changes.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • The package is a single Blade directive (@boost / @endboost) registered as a Composer-installed Laravel library. There is no service-provider surface, no config file, no migrations, and no runtime middleware — it is a compile-time template hook. That makes its architectural footprint near-zero and its removal cost near-zero, which is the most important thing a TPM can say about it.
  • Its role in the stack is developer-loop performance and template ergonomics, not product capability. It replaces ad-hoc @production / env('APP_ENV') guards that teams already hand-roll. That places it in the "non-differentiating utility" bucket: correct default is to avoid owning custom code for it, provided the dependency is cheap and trustworthy.
  • Critically, it changes the rendered output based on environment. Any package that makes local and production views structurally different needs to be treated as a behaviour-switching dependency, not a formatting helper. That is the axis the on-file assessment does not cover — that document evaluates the v1.2.0 release mechanics (Composer constraints, CI matrix) rather than the package's actual fitness. This evaluation closes that gap.
  • Nuance on "skipped": a Blade directive compiles to PHP emitted at view-compile time, so the block's markup is still parsed and compiled — it is the execution and rendering that is suppressed. That is the correct behaviour if the cost being avoided is slow partials, queries, or API calls. It does not reduce view-compilation cost, and it should not be sold internally as a fix for oversized templates.

Integration feasibility

  • Integration effort is genuinely trivial: composer require, restart, wrap a section. No configuration, no publish step, no migration. A developer can validate the whole thing in an afternoon.
  • The real feasibility question is not "can we install it" but "do we want environment-conditional rendering in our template layer at all," and if so, "do we want a 39-star single-maintainer package to be the enforcement point." Both are answerable without code.
  • Feasibility risk is concentrated in environment detection correctness, not in the package's code. If the package derives its decision from app()->environment('local') or APP_ENV, then the correctness of every boosted section in staging and production depends on a single string in a .env file that platform teams routinely template, copy, and occasionally mis-set.

Technical risk

  • Silent content suppression (highest severity). If APP_ENV is local in any deployed environment — a copied .env, a misconfigured container, a preview environment that reuses the local template — the boosted sections vanish with no exception, no log line, and no error page. The result is a page that renders successfully with content missing. This is a P1-class failure mode with near-zero detectability from application logs; it must be caught by assertion tests or post-deploy smoke checks, not monitoring.
  • Local/production divergence. Bugs in boosted regions cannot be reproduced locally by default. A designer or FE engineer iterating locally will not see the expensive section at all unless they know the escape hatch. That is a real onboarding and QA tax, and it is the cost side of the speed win.
  • Asset and stack divergence. If a boosted block contains @push directives for scripts or styles, those pushes will not occur locally but will in production. Layout-level asset bundles can therefore differ between environments in ways nobody is looking at.
  • Maintainer concentration. 39 stars, single named maintainer, MIT, no evidenced security policy or SLA. For a utility of this size the abandonment risk is mostly an inconvenience (you can inline the directive), but a TPM should record it rather than assume otherwise.
  • Framework coupling is low but non-zero. v1.2.0 widens Composer constraints for Laravel 13 and adds it to the CI matrix. Because the package touches Blade internals (the compiler surface most likely to shift across majors), framework-version support is a genuine dependency, not a formality.

Key questions

  • Does @boost decide at compile time or runtime, and does flipping APP_ENV require a view:clear / recompile of cached views? This determines our deploy runbook.
  • What exactly is the suppression predicate — app()->environment('local'), an explicit config key, or a list of environments? Can we override it per-environment (e.g. enable in staging but not local)?
  • Is there an escape hatch to force-render locally (env var, config flag) so QA can see the boosted regions on demand?
  • Do the Laravel 13 CI jobs actually execute, and are they required checks rather than advisory?
  • Does the widened constraint drop support for the Laravel major we currently run? Release notes only describe additions.
  • Are @push, @once, @section, and component slots inside a boosted block handled predictably?

Integration Approach

Stack fit

  • Standard Laravel + Composer + Blade. Compatible with the Blade compiler pipeline and composes with existing directives and conditionals, per the README.
  • Verify the application's PHP version against the package's matrix before pinning; Laravel 13 support in the package does not lift our runtime.
  • No config, routes, or migrations to reconcile with the skeleton — one of the few dependencies where the "does it fit our app structure" question has a short answer.

Build vs. buy vs. inline (the actual decision)

Three viable paths, in ascending order of control:

  1. Adopt the package. Zero code, upstream maintains framework compatibility. Cost: external dependency, environment-conditional behaviour owned elsewhere, single-maintainer risk.
  2. Inline the directive in AppServiceProvider. Roughly a dozen lines using Blade::directive(). Cost: we own it; benefit: we own the predicate, the escape hatch, the logging, and the ability to make it fail loudly.
  3. Blade component or @unless(app()->isLocal()) at call sites. No dependency at all, but reintroduces the scattered-conditionals problem the package exists to solve.

A TPM recommendation: adopt path 1 for speed, but wrap it behind a project-owned directive alias (e.g. our own @expensiveSection that delegates to @boost) so path 2 is a one-file swap and call sites never change. That converts an external dependency into an implementation detail for the cost of a few lines — the correct trade for a low-star utility on a hot path.

Migration path

  1. Inventory existing @production, env() and app()->isLocal() guards in Blade views — this is the true scope and it is measurable before any code is written.
  2. Pin the version; confirm the constraint covers our current Laravel major, not just Laravel 13.
  3. Introduce the project-owned alias, adopt it in one high-cost view first, and measure the local reload improvement to confirm the premise. If reload time does not move materially, stop and revert — the package is solving a problem we may not have.
  4. Roll out to remaining call sites in a single PR, replacing the ad-hoc guards so there is exactly one mechanism.
  5. Add a production smoke assertion that the boosted regions render, before this goes anywhere near a shared environment.

Compatibility

  • No breaking changes or deprecations are called out in v1.2.0; SemVer contract implies backward compatibility for existing users.
  • Forward compatibility with Laravel 13 is asserted by constraint and CI, and should be independently confirmed against our PHP version and database drivers.
  • During any phased framework rollout, confirm the package supports both the old and new Laravel lines simultaneously — the whole point is that it will be present in every environment while versions differ.

Sequencing

  • Do this now, on the current Laravel line, as an isolated change with its own regression pass. Do not bundle it with the Laravel 13 upgrade; the package is not a blocker there and combining them makes attribution impossible if something breaks.
  • Treat the Laravel 13 constraint widening as an independent, already-cleared item on the platform-upgrade track, as the on-file assessment concludes.

Operational Impact

Maintenance

  • Active maintenance signal is positive: a vendor shipping CI coverage for a new framework major is more meaningful than one merely widening a constraint. That weighs toward adoption over an in-house equivalent we would re-certify every cycle.
  • Release cadence appears compatibility-driven with a static feature surface. Acceptable for a utility; would not be acceptable if we expected the package to grow with our needs — we do not.
  • Pin in composer.lock, review on a regular cadence, and do not accept uncontrolled minor bumps into Blade-layer dependencies.

Support

  • No documented support policy, security response process, or deprecation timeline. For a directive that can suppress production content, that absence is tolerable only because the blast radius is bounded by the wrapper abstraction.
  • Name an internal owner. The fallback plan is the inlined directive — document it now, while it is cheap, rather than during an incident.

Scaling

  • Runtime cost is negative in local and effectively zero in production: one branch per boosted region. No scaling implications.
  • The one scaling-adjacent behaviour to confirm is interaction with view:cache. If suppression is resolved at compile time, cached views in a container image could bake in the wrong environment's output. That is a deploy-pipeline concern, not a throughput concern, and it is the single most likely way this package causes a production incident.

Failure modes

Failure Detection Mitigation
APP_ENV=local in a deployed environment suppresses content silently Only via content assertions or smoke tests Assert boosted regions render in post-deploy checks; alert on missing markers
Stale compiled views bake in the wrong branch Deploy-time diff or content assertion view:clear / rebuild views in the image build, not at runtime
Local bugs in boosted regions go unnoticed QA report / "cannot reproduce" Document the force-render escape hatch; include boosted regions in CI browser tests
Asset stack divergence from @push inside boosted blocks Visual regression in staging Avoid @push inside boosted blocks; keep them content-only
Composer conflict on a future Laravel major composer update in CI Required CI job that resolves against the next major early
Upstream abandonment Package staleness Pre-wrapped behind project-owned alias; swap to inline in one file

Ramp-up

  • Effectively zero for anyone who knows Blade; the directive is self-explanatory and documented in one line.
  • The real ramp-up cost is tribal knowledge: engineers must learn that some sections are invisible locally by design, and how to force them. Put that in the README and the onboarding doc, or you will pay for it repeatedly in "the page is broken" tickets.
  • Budget the actual effort against the Laravel 13 upgrade and the smoke-test work, not against installing this package. Installation is an hour; making it safe to run in production is the deliverable.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource