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

Htmlpagedom Laravel Package

wa72/htmlpagedom

wa72/htmlpagedom is a PHP library that extends DOMDocument for easy HTML manipulation with jQuery-style methods and CSS selectors. Load HTML strings or files, then query and modify elements using familiar find, filter, addClass, attr, and append APIs, powered by Symfony CssSelector.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

  • Architecture fit: wa72/htmlpagedom is a Composer library that extends Symfony’s DomCrawler with jQuery-like DOM traversal/manipulation. It is not Laravel-native: no service provider, facade, config, or queue integration. That is acceptable for a utility library, but the TPM should treat it as an internal adapter-wrapped dependency rather than a framework feature. It fits Laravel services, jobs, commands, and content-transformation pipelines where server-side HTML parsing/manipulation is needed. v3.1.0 does not change this positioning — it reinforces it by tracking Symfony’s release cadence rather than adding framework features.
  • Integration feasibility: Straightforward composer require in a Laravel app, assuming compatibility with the app’s PHP, Laravel, and Symfony component versions. It pulls/requires Symfony dom-crawler and likely css-selector. Laravel’s HTTP client can fetch content, then the package can parse and manipulate the response body. The main integration work remains a thin application wrapper to isolate its API and to enforce sanitization/escaping before output. Note the version floor moved: v3.1.0 requires PHP ≥ 8.1, so apps on PHP 8.0 (Laravel 9 and earlier) are now excluded. That is a non-issue for Laravel 10–12, which already require PHP 8.1+.
  • Technical risk: Moderate-low, slightly reduced on the forward-compatibility axis. v3.1.0 adds Symfony 8 support, which is a meaningful signal that the package is maintained and intends to survive the next Laravel/Symfony major cycle (a future Laravel release will sit on Symfony 8). Two caveats: (1) the release simultaneously raised the minimum PHP to 8.1 — a compatibility floor change shipped in a minor version, which is a versioning-governance signal worth noting for consumers who pin loosely; (2) the adoption signals are unchanged (337 stars, 0 dependents, no Laravel-specific evidence), and it remains a small, effectively single-maintainer project. Existing risks still stand: coupling to Symfony Crawler internals, libxml parsing quirks on malformed markup, and unsafe output if used on untrusted HTML. It is still not an HTML sanitizer.
  • Key questions: Does 3.1.0 retain Symfony 6 and 7 support, or did the Symfony 8 addition come with a floor bump that would strand Laravel 10–12 apps? (Symfony 8 itself requires PHP 8.4, so a single release spanning Symfony 6/7/8 must carry wide Composer constraints — verify the actual resolver output, not just the headline.) Did anything in the DomCrawler 8 line change selector or serialization behavior that affects our fixtures? Which Laravel/PHP/Symfony versions must we support today, and which is the first Laravel release expected on Symfony 8? Is our use case string-based transformation, remote-page scraping, or both? Will output be rendered to users, and if so, what sanitization layer is required? Is ext-dom/libxml guaranteed in production? What is the fallback if the package is abandoned or its release cadence lags a future Symfony major? Do we need HTML5-spec parsing rather than libxml behavior?

Integration Approach

  • Stack fit: Best suited as an isolated utility inside a Laravel service class, e.g. an HtmlDomTransformer adapter. Use Laravel’s HTTP client for fetching, the package for DOM manipulation, and Laravel/Blade escaping or a dedicated sanitizer before rendering. Avoid direct package calls scattered across controllers or Blade templates. It pairs naturally with existing Symfony Crawler usage but should not become a de facto framework standard without broader validation.
  • Migration path: Start with a low-risk, non-user-facing use case such as a queued content-normalization job or an internal scraping command. Add golden-file tests for representative HTML, including malformed fragments and edge-case selectors. If replacing regex/string manipulation, migrate one transformation at a time behind a feature flag. Keep an adapter interface so the implementation can fall back to raw DomCrawler or DOMDocument. v3.1.0 does not change this path or introduce migration work of its own.
  • Compatibility: The matrix needs re-verification, not relaxation. Confirm that 3.1.0 still resolves against Symfony 6/7 components (Laravel 10–12) and that it resolves cleanly against Symfony 8 for a future upgrade — these are two different tests. Verify PHP 8.1–8.4, and note that Symfony 8 branches will effectively require PHP 8.4. Run composer why-not and a clean-app composer update in both configurations before adopting. Confirm ext-dom and libxml availability in CI and production. Pin the package and Symfony DOM components to tested majors; because v3.1.0 raised its PHP floor in a minor release, treat upstream minors as potentially floor-breaking and rely on lockfile pinning plus CI to catch it. Re-run malformed-HTML fixtures, since selector behavior and serialization may differ across DomCrawler majors.
  • Sequencing: 1) Dependency/compatibility spike in a branch, testing both the current Symfony major and Symfony 8. 2) Build adapter and test harness. 3) Integrate one bounded use case. 4) Add sanitization, logging, and failure handling. 5) Expand only after production evidence. Keep the feature flag and a rollback path to Symfony Crawler/DOMDocument. The Symfony 8 announcement is forward-looking enablement, not a reason to upgrade our stack — do not let it pull the application onto Symfony 8 ahead of Laravel’s own support. If the compatibility spike fails, do not force it; use Symfony Crawler directly or an alternative HTML5 parser.

Operational Impact

  • Maintenance: Low implementation surface but non-zero stewardship. The TPM should assign internal ownership, monitor releases and security advisories, and keep dependency updates gated by tests. The adapter layer remains the main mitigation against abandonment or API changes. v3.1.0 is a positive maintenance signal — the project is responding to upstream Symfony releases rather than drifting — but it also demonstrates that upstream minors can carry floor changes, so dependency-update PRs from this package should require review rather than auto-merge. No Laravel-specific maintenance burden, but also no Laravel community support path.
  • Support: MIT OSS with no SLA. Support is GitHub-based and community-driven; the Symfony 8 work was a community contribution, which is encouraging but does not create a support commitment. Internal documentation should cover supported selectors, expected HTML inputs, sanitization requirements, and error behavior. Document the supported PHP/Symfony matrix explicitly, since the package’s own floor has now moved once. Do not rely on upstream for production incidents.
  • Scaling: Stateless and horizontally scalable, but DOM parsing is CPU- and memory-intensive per document. Use queued jobs for bulk scraping/transformation, enforce memory limits, and avoid parsing large pages in synchronous web requests. Cache transformed output where possible. Large or concurrent workloads should be benchmarked before rollout. Unchanged by this release.
  • Failure modes: Malformed HTML may parse differently or emit libxml warnings; missing ext-dom causes runtime failure; Symfony version conflicts can block upgrades — and v3.1.0 introduces a new variant, where a permissive constraint silently resolves to a release whose PHP floor or Symfony range does not match our runtime; selector mismatches may silently return empty results; unsanitized output can create XSS risk; remote fetching can introduce SSRF/timeouts; large documents can exhaust memory. Handle exceptions, validate selector results, sanitize output, set HTTP timeouts, and log parse failures with safe payload metadata. Add a CI check that fails on unexpected platform-requirement changes during dependency updates.
  • Ramp-up: Low for developers familiar with jQuery or Symfony Crawler; moderate for teams unfamiliar with DOM selector edge cases and libxml behavior. A short spike plus representative test fixtures should be sufficient. The TPM should budget for an adapter, tests, sanitization review, a two-configuration compatibility check (current Symfony line and Symfony 8), and a rollback plan rather than treating this as a drop-in Laravel package.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
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