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

Pug Filter Stylus Laravel Package

pug-php/pug-filter-stylus

Adds Stylus stylesheet support to Pug templates in PHP, so you can write Stylus inside your .pug files and have it compiled automatically. A small filter plugin for the pug-php renderer—install it, register the filter, and keep styles alongside your markup.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package positions itself as a drop-in view engine for Laravel's View subsystem, registering a Pug compiler alongside the default Blade engine via the framework's engine resolver. That is a well-trodden extension point, so architectural fit is good: .pug templates coexist with .blade.php without fighting the framework, and no core patching is required. The trade-off is that it adds a second templating dialect to the codebase, which is a team-standardisation decision more than a technical one.

Integration feasibility. Expect the standard Laravel package footprint — Composer install, auto-discovered service provider, publishable config, and a compiler cache directory. Integration effort is low for a greenfield feature area and moderate for an existing app, since the work is really about deciding where Pug is permitted (e.g. marketing pages or email templates) versus leaving existing Blade untouched.

Technical risk. The entirety of the 2.1.0 signal is "Pug-php 3 compatibility." That is a major-version alignment with the upstream compiler, which is the highest-risk class of change for a thin wrapper package: the wrapper's own API may be unchanged while the behaviour of the underlying compiler shifts. Specific risks to close out before adoption:

  • PHP version floor. Pug-php 3 raises the minimum PHP requirement. Confirm it matches the runtime target; this is the most common cause of a failed install on older Laravel estates.
  • Transitive dependency graph. Major bumps often pull in new parser/lexer dependencies. Diff composer.lock rather than trusting the one-line note.
  • Behavioural drift. Escaping defaults, attribute handling, whitespace/pretty-print, and error message surface are the areas that historically change between major compiler versions.
  • Maintenance depth. Single-maintainer packages with a hard dependency on a fast-moving upstream are a concentration risk worth naming explicitly.

Key questions.

  1. What is the supported Laravel-version and PHP-version matrix for 2.1.0, and is it declared in composer.json constraints?
  2. Is 2.1.0 a hard cut-over (pug-php 3 only) or does it retain a constraint allowing pug-php 2? This determines whether the upgrade is opt-in per project.
  3. Are there breaking changes in 2.0.x → 2.1.0 beyond the dependency bump, and is there a changelog entry with more detail than the release title?
  4. What is the template compilation and caching strategy — on-demand with a filesystem cache, or precompiled at build time?
  5. Does the package have a CI matrix covering the Laravel/PHP versions we care about, and are there tests exercising the pug-php 3 path specifically?

Integration Approach

Stack fit. Clean fit for any Laravel application on a currently supported PHP line. The main gate is the PHP floor introduced by pug-php 3 — verify against the target runtime before committing, as this is the single most likely blocker and it is cheaper to discover from composer why-not than from a failed deploy.

Migration path. Two distinct paths, and they should not be conflated:

  • New adoption. Install, publish config, add one non-critical .pug view, verify render + cache behaviour, then widen scope. Low risk.
  • Upgrade from a pug-php 2-based install. Treat as a dependency upgrade, not a package upgrade. Branch, bump the constraint, run composer update on the package and its upstream only, clear the compiled-view cache, then render every existing Pug template in a smoke test and diff the HTML output. Whitespace and escaping diffs are the expected failure surface.

Compatibility. Confirm three axes independently: (a) Laravel framework version supported by the package, (b) PHP version required by pug-php 3, (c) any other Laravel packages that register view engines or hook the compiler. Also check whether the package's config file schema changed between the previous and current minor line, since published config files are a common silent-breakage vector after a major upstream bump.

Sequencing.

  1. Read the full changelog / compare the diff between the previous tag and 2.1.0 (the release note alone is insufficient evidence).
  2. Verify the compatibility matrix against our Laravel and PHP versions.
  3. Evaluate in a scratch branch with a representative template corpus.
  4. Land in staging behind a feature flag limiting Pug usage to a defined area.
  5. Promote to production with the compiled-view cache cleared as part of the deploy step.

Operational Impact

Maintenance. The package is a thin adapter, so most of the maintenance burden actually sits with the upstream compiler. The recurring cost is version-chasing: every pug-php major release forces a corresponding package release, and there is a window where the two are out of step. Budget for periodic dependency reviews rather than assuming the package is inert.

Support. Expect community-level support — GitHub issues, no commercial backing. For a templating layer that touches every rendered page, that is a real consideration. Document internal ownership explicitly; do not let it become an unowned transitive dependency.

Scaling. Runtime compilation is the thing to measure. Compiled-template caching makes steady-state rendering cheap, but cold caches, deploys that clear the cache, and per-request compilation on uncached templates all create latency spikes and CPU burn under load. If Pug is used on high-traffic paths, precompile at build/deploy time and treat the cache directory as a deploy artefact rather than a runtime warm-up target. The filesystem cache also needs to be shared across horizontally scaled instances — a per-container cache means every instance compiles independently.

Failure modes.

  • Compile-time failures surface at render time — a malformed template becomes a 500 on the page that uses it, not at build. Mitigate with a render smoke test over all templates in CI.
  • Stale compiled cache after a deploy that doesn't clear it — classic "works locally, wrong in prod" symptom.
  • Dependency resolution deadlock if another package pins pug-php 2, blocking the Laravel or PHP upgrade path.
  • Silent output drift after a compiler major bump — no exception, just different HTML. Mitigate with output snapshot tests on a template corpus.
  • Unmaintained upstream leaving the package stranded on an unsupported Laravel version.

Ramp-up. Developers coming from Node/Pug transfer immediately; developers who only know Blade need real ramp-up time on Pug's indentation-sensitive syntax and mixin model, and its error messages are generally less friendly than Blade's. The practical mitigation is to scope Pug to a bounded area with a small, stable template set rather than making it the default engine, which keeps the blast radius of both syntax mistakes and compiler upgrades contained.

Verdict on 2.1.0. The release is a compatibility alignment, not a feature release. It is worth adopting — staying on a pug-php 2 constraint creates a growing upgrade debt and an eventual dead end — but the one-line note is not sufficient evidence to approve it. Request the full diff and changelog, confirm the PHP/Laravel matrix, and gate adoption on a template-corpus render test.

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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib