dante918/livewire-pdf-preview
Livewire PDF Preview provides a reusable Livewire component for embedding and viewing PDF documents in Laravel applications. It supports configurable viewer controls, responsive sizing, and simple Blade integration, making it easy to add interactive PDF previews without building a custom viewer.
Architecture fit
pdf.js, bundling the client-side renderer (pdf.js) and its Web Worker (pdf.worker.js) plus an install/publish command.Integration feasibility
composer require, run the (renamed) install command, publish config/assets. The 1.0.2 custom worker path parameter removes the main historical blocker — teams serving assets from a CDN, a non-standard public/ layout, or a Vite/@vite pipeline can now point the worker at wherever it actually lives instead of patching vendor files.vendor:publish group.Technical risk
pdf.js and pdf.worker.js must be the same build. The 1.0.2 upgrade moves both together, which is correct, but any consumer who previously copied or pinned the worker manually (a common workaround before this release) now has a mismatched pair and will hit The API version "X" does not match the Worker version "Y". This is the single most likely breakage from this release.pdf.js builds drop legacy browser support and modernise syntax (optional chaining, Promise.allSettled, module workers). Apps still supporting older Safari/Edge or non-module bundlers may regress even though this is a patch bump.worker-src (and often blob:) in Content-Security-Policy. A new worker path, especially cross-origin, can trip CSP and CORS. Custom worker path widens this surface.Key questions
pdf.js version is bundled, and does the package expose it (constant/config) so we can audit CVEs and browser support?crossorigin attribute handled?type: "module") or classic script? Does that constrain our bundler?Stack fit
Migration path
composer update; no data migration, no schema, no queue restart.vendor:publish --tag=<package> --force) so the upgraded worker actually lands. Silent stale-asset overwrite failures are the most common post-upgrade symptom.Compatibility
pdf.js build against our browser support matrix before production — specifically older Safari and any embedded webview in use.worker-src 'self' blob: <cdn-host> if a custom path is configured.Sequencing
pdf.js version; cross-check browser targets and CVE status.worker path in config if serving from CDN/custom location; verify CSP and CORS.Maintenance
pdf.js ships roughly monthly. Each tracking release means re-publishing assets and re-running the browser/CSP checks. Budget a recurring line item rather than a one-off.composer.lock and treat upgrades as deliberate, tested changes — 1.0.x is not a stability signal.Support
Scaling
pdf.js from a CDN with long cache TTLs; these are immutable per version. Cache-busting must be tied to the bundled version or clients will pin stale workers indefinitely.Failure modes
Access-Control-Allow-Origin on the CDN host.Ramp-up
pdf.js version-tracking cadence and the smoke test. Assign that owner at adoption, or the pin will drift until a CVE forces an untested jump.How can I help you explore Laravel packages today?