pug-php/pug-filter-less
A Pug filter for the PHP Pug templating engine that compiles Less stylesheets. Write Less inside your templates with a :less block and get processed CSS at render time, streamlining asset handling for PHP projects.
Architecture fit. 1.1.0 is a dependency-compatibility release: it aligns the Laravel view-layer wrapper with pug-php 3 (the Phug-based rewrite of the Pug/Jade compiler). Architecturally the package remains a thin adapter — service provider plus a view finder that registers a .pug/.jade extension and delegates compilation to the upstream engine. It does not alter Laravel's view contract, so it stays a drop-in alongside Blade rather than a replacement. The important architectural fact is that the package now sits on a different compiler generation than before, which means the abstraction boundary is doing real work: everything the wrapper exposes (config keys, cache paths, renderer options) is a projection of an upstream API that changed shape.
Integration feasibility. Straightforward for greenfield: composer require, auto-discovered provider, publish config, drop templates into resources/views. Non-trivial for existing installs, because "pug-php 3 compatibility" is almost certainly a breaking change for the wrapper's own public surface — major-version bumps of the underlying engine have historically renamed options (basedir → path arrays, pretty/extension semantics), changed the cache layout, replaced custom-keyword/filter extension points, and tightened the PHP floor (pug-php 3 requires PHP 7.x-era language features). Any project pinning the old renderer, or carrying a cache directory compiled by it, must be treated as a migration, not an upgrade. This is a semver-minor release (1.0.x → 1.1.0) that wraps a semver-major upstream bump — that mismatch is the single largest feasibility risk and should be raised with the maintainer.
Technical risk. Medium-to-high, concentrated in four places: (1) silent rendering drift — Pug output is whitespace- and attribute-order-sensitive, so a compiler generation change can alter markup without erroring; (2) cache staleness — old compiled templates in storage/framework/views or a package-specific cache dir will be served unless explicitly purged, producing failures that look like code bugs; (3) extension-point breakage — custom filters, keywords, and mixins registered against the old engine's API; (4) transitive dependency conflicts — the wrapper now needs pug-php 3, which cannot coexist with a project still requiring pug-php 2, and the conflict surfaces at composer update time in unrelated packages. Lower risk: error-message and stack-trace changes degrading debuggability, and asset/localization helpers behaving subtly differently.
Key questions. Does 1.1.0 drop pug-php 2 support entirely, or is it a dual-support release with a version constraint branch? What is the minimum PHP version after this bump, and does it match our supported matrix? Are the wrapper's config keys renamed or merely passed through — is there a documented mapping from 1.0.x options? Is there a supported cache-invalidation path, and does the compiled-template format change? Are custom filters/keywords still supported, and through which API? Is there an upgrade guide, a changelog entry beyond one line, and CI coverage against both Laravel and PHP version pairs we run? Who maintains the package, and what is the release cadence and issue-response history?
Stack fit. Good fit for teams with front-end developers already fluent in Pug, or for projects importing an existing Pug component library into a Laravel app. It composes cleanly with Blade — Blade for layout composition and directives, Pug for presentational partials — and the view finder resolves by extension, so templates can be adopted incrementally per-directory. It fits poorly where the org has standardized on Blade/Tailwind component conventions; Pug then becomes a second templating dialect with its own tooling, linting, and onboarding cost for no functional gain. This release does not change that calculus; it only makes the package viable on a modern PHP baseline.
Migration path. Treat 1.1.0 as a new integration rather than a patch. Sequence: inventory all .pug/.jade templates and any custom filters, keywords, or pug.options config in config/pug.php; pin the previous version in a branch and build a fixture suite that renders every template, capturing normalized HTML output; bump to 1.1.0 in that branch, purge all compiled caches, re-render, and diff against the fixtures. Any diff is either an expected compiler improvement or a defect — classify each one before proceeding. Custom extension points get rewritten against the new API or dropped. Only after the diff is clean does the change move to shared environments. If the project is on pug-php 2 via other dependencies, resolve that conflict first; do not attempt to run both engines.
Compatibility. Confirm the wrapper's Laravel support range against our version — wrapper packages frequently lag Laravel majors, and a one-line release note gives no evidence either way. Verify the PHP floor against CI images, the pug-php 3 constraint is satisfiable alongside our locked dependency graph, and that no second package pulls in pug-php 2. Check that dev tooling (IDE plugins, linters, asset pipelines that precompile Pug) targets the same Pug dialect version, since Phug-era syntax support differs at the edges.
Sequencing. (1) Read the actual diff and composer.json constraints, not the release note. (2) Reproduce in a spike branch with the fixture-diff harness. (3) Land behind a config flag or separate environment, cache purge included in the deploy step. (4) Soak in staging with real template volume. (5) Roll to production as a standalone deploy — never bundled with unrelated framework upgrades, so a rendering regression has an unambiguous cause and a clean revert.
Maintenance. The package is a thin wrapper over a fast-moving upstream, so its maintenance cost tracks pug-php's, not its own. Expect the wrapper to lag upstream releases; the one-line changelog is itself a signal of thin release documentation, which means the team upgrading absorbs the research cost. Budget for owning a fixture-based render regression suite — without it, every future compiler bump is unverifiable. The 1.0 → 1.1 jump also implies a documentation pass: any internal runbook referencing old config keys or the old cache path is now wrong.
Support. Support load concentrates on two populations: developers hitting compile errors whose messages originate in a third-party compiler (stack traces will point into vendor/, which is unfamiliar), and operators hitting stale-cache symptoms that present as rendering bugs. Neither is diagnosable by a generalist without a runbook. Establish a short triage doc: how to clear the compiled cache, how to enable verbose compiler output, how to tell a compile failure from a cache miss. Escalation beyond that goes to the package maintainer, whose responsiveness is an unquantified dependency — assess it before adoption, and be prepared to fork, since the wrapper is small enough that forking is a realistic fallback.
Scaling. Runtime cost is dominated by the first render per template; subsequent requests hit compiled PHP and are served through OPcache like any other view. Scaling risk is therefore concentrated at deploy time and at cache-cold events (new app servers, cache wipes, autoscaling bursts), when many instances compile templates concurrently and compete for the same cache directory. On multi-node deployments, ensure the compiled cache is either node-local and warmed during the deploy, or on shared storage with atomic writes — a partially written compiled template is a hard failure. Compilation is CPU-bound and blocking, so cold-start latency is materially worse than Blade's; account for it in readiness probes and warmup scripts.
Failure modes. Highest-impact: a template that compiles under the old engine but errors or renders differently under the new one, discovered in production because the fixture suite covered Blade paths but not Pug partials. Second: stale compiled templates served after upgrade, producing a mix of old and new output across nodes — an intermittent, extremely confusing symptom class. Third: composer update failing on a transitive pug-php 2 constraint in an unrelated package, blocking routine dependency maintenance. Fourth: cache-directory permission or disk exhaustion causing render-time 500s rather than graceful degradation. Fifth: custom filters silently no-op'ing after the API change, emitting unstyled or unescaped output without an exception — the worst failure mode, because it is invisible.
Ramp-up. Front-end developers already fluent in Pug ramp in days; backend developers coming from Blade need roughly a sprint to become productive, and longer to be safe with mixins, interpolation, and whitespace-sensitive output. The upgrade itself is a half-day for a team with the fixture harness in place and multiple days without it. Recommend one owner for the template layer and one for the upgrade, with the upgrade owner responsible for the diff classification, the cache-purge deploy step, and writing the triage runbook — otherwise the knowledge concentrates in whoever happened to run composer update and leaves with them.
How can I help you explore Laravel packages today?