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

Laravel Pug Laravel Package

bkwld/laravel-pug

Adds Pug (formerly Jade) template support to Laravel. Register the .pug extension and write views with Pug's concise, indentation-based syntax—mixins, includes, and layouts included—while Laravel handles rendering and caching. Works alongside Blade templates.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

What shipped: 2.5.0 is a single-line change — the phug/phug constraint was widened to permit Phug 2.x. No new APIs, no deprecations, no documented breaking changes at the laravel-pug level. The changelog contains no migration notes, no test-matrix disclosure, and no statement of which PHP/Laravel versions were validated against Phug 2.

Architecture fit: BKWLD/laravel-pug is a thin adapter, not a framework. It registers a view engine with Laravel's view finder, delegates parsing/compilation to Phug, and emits cached PHP into storage/framework/views. It has no persistence, no queue surface, no runtime services, and no meaningful cross-cutting concerns. That makes it architecturally cheap to adopt and cheap to remove — the coupling is to the template syntax, not to the package.

Integration feasibility: High. composer require plus (optionally) publishing config; views resolve as view('pages.home') against .pug files. A spike can be completed in 1–3 days on an existing Laravel app. The real gate is not integration effort, it is dependency resolution and PHP-version compatibility on the Phug 2 path.

Technical risk: The dominant risk in this release is semver signal, not code. Widening a constraint to accept a new major of a compiler dependency is, for consumers, a behavioural change even though it is additive on the package's own API. Specific concerns:

  • Non-deterministic resolution. Two environments running composer update on the same composer.json can resolve Phug 1.x and Phug 2.x respectively. Identical source, different compiled output. This is the highest-severity issue and is fixed only by explicit pinning.
  • Compiler behaviour drift. A major bump of the underlying engine implies changed option semantics, changed escaping/whitespace handling, and possibly changed handling of custom keywords/Phug\Renderer configuration. Without a published test matrix, assume nothing about parity.
  • Stale compiled-view cache. Cached PHP generated by Phug 1 is not guaranteed to be invalidated by a Phug upgrade. Deployments must force a view-cache clear, not just a cache warm.
  • PHP floor. The Phug 2 path likely raises the effective PHP requirement. Verify against the app's actual runtime before planning upgrades.

Key questions to take back to engineering:

  1. Does the CI matrix actually exercise Phug 1.x and 2.x, and against which Laravel/PHP combinations?
  2. Is Phug 1.x still permitted by the constraint (i.e. is this additive, or did the floor effectively move)?
  3. Are there documented Phug 1→2 behavioural changes affecting escaping, whitespace, or custom keywords used in our templates?
  4. Does the service provider pin any Phug renderer options whose defaults changed in Phug 2?
  5. What is the maintainer's support horizon and release cadence for this package, and what is our exit cost to Blade if it stalls?

Verdict: Adopt with explicit version pins. Do not let this dependency float.

Integration Approach

Stack fit: Good for Laravel shops that already have Pug familiarity on the front end, share templates or design-system partials with a Node toolchain, or are consolidating a legacy Jade/Pug asset pipeline into server-side rendering. Poor fit for teams with no Pug exposure — the two-dialect cognitive tax (Blade and Pug) is real and permanent.

Migration path: Treat this as greenfield adoption (there is no prior assessment to reconcile).

  1. Spike in a throwaway branch against the lowest PHP/Laravel version in our supported matrix.
  2. Convert one low-traffic, low-complexity view; diff rendered HTML byte-for-byte against the Blade equivalent.
  3. Confirm the compiled output is stable across two consecutive compiles and across a cache clear.

Compatibility: The single most important action is to state the Phug major we intend to run, explicitly, in composer.json — either phug/phug: ^2.0 (deliberate opt-in to the new path) or ^1.0 (deliberate stay). Relying on the package's widened constraint to "figure it out" is the failure mode this release introduces. Commit composer.lock. Add a CI assertion on the resolved Phug version so a transitive bump cannot land unnoticed.

Sequencing:

  1. Pin and lock — declare the Phug major, commit the lockfile, add a resolution check to CI. Do this before any template work.
  2. Compatibility gate — confirm PHP and Laravel versions against the Phug 2 path; if the app is not yet on the required PHP floor, stay on Phug 1 and record the upgrade as a prerequisite.
  3. Compile-check step — add a CI job that compiles all .pug views without rendering them, so template syntax errors fail the build rather than the request.
  4. Template-by-template conversion — smallest/least-trafficked first, HTML-diff gated.
  5. Deploy runbook — view:clear (forced, not conditional) on every release that touches the compiler or templates, then warm on each node.
  6. Exit-path note — record the estimated Blade rewrite effort for the converted templates while the conversion is fresh; it is the cheapest moment to capture it.

Operational Impact

Maintenance: Low ongoing effort, moderate vendor risk. This is a small, single-maintainer package wrapping a community-maintained compiler, and this release's one-line changelog is a signal of light release discipline. Budget for self-directed diligence on every bump rather than expecting upstream guidance. Dependabot/Renovate should flag this package for manual review, never auto-merge.

Support: No commercial backing. Issue-tracker support only. Escalation path is: read Phug's own changelog, reproduce in a bare Phug script, then file upstream. Keep the adapter thin in our own code — no subclassing of Phug internals, no monkey-patching — so an upstream stall is a swap, not a rewrite.

Scaling: Effectively free at runtime. Compilation is one-time and cached; steady-state render cost is comparable to compiled Blade. The scaling considerations are all cold-path:

  • Cold cache after deploy multiplies first-request latency across every distinct view. Warm the cache per node, or share the compiled-view directory where the topology permits.
  • Template count drives deploy-time warm duration; large template libraries should warm asynchronously in the release pipeline, not on live traffic.

Failure modes to instrument:

  • Silent Phug major drift on an unpinned composer update → rendering breaks or shifts on deploy with no source change. Mitigation: pin + CI resolution assertion.
  • Stale compiled views after upgrade → correct templates render incorrectly until cache clear. Mitigation: unconditional view:clear in the deploy runbook.
  • Runtime-only syntax errors → 500s on first hit of a bad template. Mitigation: CI compile-check.
  • Transitive conflict with another package depending on Phug → resolution failure at install time, which is at least loud; the quiet inverse (resolving a major we didn't intend) is the dangerous one.
  • Silent output drift (escaping, whitespace) that passes no test because nobody diffs rendered HTML. Mitigation: golden-file snapshot tests on a handful of representative views.

Ramp-up: Low for Laravel developers — the view API is idiomatic and the package is small enough to read end-to-end in an afternoon. Moderate for Pug syntax itself, and there is a persistent context-switching cost for anyone moving between Blade and Pug files in the same codebase. Plan for one engineer to own the templating layer and produce a short internal style guide covering escaping, partials, and where Pug ends and Blade begins.

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.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast