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

Amp Html Bundle Laravel Package

takeit/amp-html-bundle

A Symfony bundle that adds AMP HTML support to your app: render AMP-compliant Twig templates, manage AMP components and styles, and serve fast, validated mobile pages alongside existing views. Includes helpers for common AMP tags and easy Composer setup.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit Despite the "Laravel/PHP package" framing, takeit/amp-html-bundle is a Symfony2/Symfony3 bundle, not a framework-agnostic library. Its architecture is tightly coupled to Symfony primitives: a DI extension loading YAML/XML service definitions, an event subscriber on kernel.response to swap the response body, a Twig extension, and bundle configuration merged into the container. None of this maps onto Laravel's service container, middleware pipeline, or Blade. The reusable asset is the thin conversion layer it wraps — almost certainly lullabot/amp, which is itself abandoned — not the packaging.

Integration feasibility Drop-in installation into a Laravel app is not feasible. Feasible paths, in descending order of effort:

  • Reference-only: read the bundle source (small codebase) to understand its transformer configuration and port the logic into a Laravel service + response middleware. Low-to-moderate effort, but you inherit any conversion shortcuts it took.
  • Standalone dependency swap: depend directly on lullabot/amp (or a maintained fork) and write your own Laravel glue. Avoids the Symfony baggage entirely — the bundle adds little that isn't one service class plus config.
  • Full port/fork: realistic only if AMP is a hard requirement and you accept owning a fork.

Technical risk — high, on several independent axes:

  • Framework EOL: Symfony 2.x and 3.x are end-of-life; the code predates modern PHP typing and will likely emit deprecations or fail on PHP 8.2/8.3.
  • Dependency risk: the underlying AMP converter is unmaintained, so DOM/CSS transformation bugs on modern HTML will not be fixed upstream.
  • Abandonment signals: 32 stars, 0 dependents, no release since March 2019, single maintainer. Effectively a dead project.
  • Product risk: AMP's strategic value has eroded — Google removed the AMP requirement for Top Stories in 2021 and dropped AMP as a page-experience signal. Committing architecture to AMP today needs an explicit justification (e.g., AMP for Email, a specific distribution channel, or a legacy contract).

Key questions

  1. Is AMP still a hard requirement for any surface we serve, and who is the stakeholder demanding it?
  2. Do we need full AMP spec compliance (validation, boilerplate, amp-img rewriting) or just lightweight HTML sanitization?
  3. Does the target runtime run PHP 8.2+? If so, does anything here even load?
  4. Are we willing to own a fork of the converter, or is there a maintained alternative (e.g., a Node amp-toolbox sidecar, or a hosted conversion service)?
  5. What is the actual cost of producing invalid AMP (de-indexing, structured-data loss) versus the cost of not doing AMP at all?

Integration Approach

Stack fit Poor for Laravel. There is no Laravel service provider, no Blade directive, no middleware. Every integration point — config tree, Twig function, response listener, route/controller conventions — must be rebuilt in idiomatic Laravel terms. Treat the bundle as a specification, not a dependency.

Migration path (if AMP is confirmed as a requirement)

  1. Extract: lift the conversion logic — the HTML→AMP transformer chain and its configuration — out of the bundle into a framework-agnostic class. In practice this means depending on the converter library directly and replicating the bundle's option set.
  2. Re-home in Laravel: bind it as a singleton in a service provider, expose config via config/amp.php, and replace the Symfony kernel.response subscriber with a response middleware or a response macro that rewrites the body for ?amp / amp. subdomain / Accept negotiation.
  3. Templating: convert Twig extension usage to a Blade directive or a view composer; ensure the rendered layout includes AMP boilerplate and the <link rel="amphtml"> back-reference on the canonical page.
  4. Routing: replicate the bundle's AMP route/format handling with an explicit Laravel route group or a dedicated subdomain — do not attempt to reuse Symfony routing conventions.

Compatibility Verify PHP constraint (^5.5|^7.x era is likely) against the target runtime before any spike. Check the transitive dependency tree for abandoned or vulnerable packages — Composer audit will likely flag issues. If PHP 8 support is absent, the "port" is effectively a rewrite with reference material, and should be estimated as such.

Sequencing

  1. Decision gate (1–2 days): confirm AMP is still required, and for which surfaces.
  2. Spike (3–5 days): port the conversion into a Laravel service; run a representative page set through the official AMP validator; measure failure rate.
  3. Alternatives review in parallel: maintained PHP converters, Node amp-toolbox sidecar, or hosted conversion APIs — compare on fidelity and operational cost.
  4. Build/buy decision, then implement middleware + caching + validation in CI.
  5. Rollout with validator in the pipeline and a canary on a low-traffic section.

Operational Impact

Maintenance Effectively zero upstream. No security patches, no PHP-version updates, no response to bug reports. Any fork we create becomes a permanent internal liability with a named owner or it will rot. Budget ongoing maintenance time even for a "just depend on it" path.

Support No vendor, no active community, no issue triage. Internal engineers are the only escalation path. Documentation is limited to the README and source.

Scaling Conversion is CPU-bound DOM manipulation performed per request. At any meaningful traffic volume this must be cached aggressively (full-page cache keyed by URL + variant) or moved off the request path into a build/precompute step. Validate memory ceilings — DOM rewriting on large HTML documents is memory-hungry, and PHP-FPM workers will surface that quickly.

Failure modes

  • Silent invalid output: converter produces AMP that fails validation; pages get dropped from AMP surfaces without an error surfacing in application logs. Mitigation: validator in CI + sampled production validation.
  • Content mangling: aggressive transformation strips or rewrites markup (forms, iframes, inline styles), degrading the canonical page or the AMP variant.
  • PHP deprecation/error surfacing on modern runtimes — potentially fatal on the response path, which means the whole site fails, not just AMP.
  • Unmaintained transitive dependencies with known CVEs.
  • Product-level failure: AMP delivers no ranking or distribution benefit, and the team has paid integration + maintenance cost for nothing.

Ramp-up Low to read — the bundle is small and the conversion concept is straightforward. High to own safely — requires AMP spec familiarity, validator tooling, and a working knowledge of the underlying converter's quirks. Realistically one engineer for 1–2 weeks to spike and evaluate, and continuing fractional ownership thereafter.

TPM recommendation Do not adopt. The package is abandoned, targets EOL frameworks, is architecturally incompatible with Laravel, and sits on a product surface (AMP) whose strategic value has substantially declined. If AMP is genuinely required, take the converter dependency directly, implement ~150 lines of Laravel middleware and configuration, and put a validator in CI — that yields a smaller, owned, testable surface than resurrecting this bundle. If AMP is not a hard requirement, the correct decision is to close the request.

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.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package