particle-academy/prism
A Laravel package for rendering beautifully highlighted code blocks with Prism.js. Use Blade components to add fast, accessible, zero-config syntax highlighting to docs, blogs, and apps, with support for many languages and themes.
Architecture fit: Prism is a Laravel/PHP LLM integration package; StreamCollector is a public streaming utility that aggregates stream events into messages. For a TPM, the architectural relevance is not the class itself but what this release reveals about the package's release contract: a public class was removed in v0.132.0 with no mention in the release notes, breaking a known downstream consumer (prism-harness 0.13.0) on a routine composer update. v0.133.1 restores the class with an identical constructor, collect() and callback signature, so it is a drop-in restoration — but the underlying event shape has changed.
Integration feasibility: Straightforward. The restored class builds messages via StreamedMessages, so output now follows the current stream shape (one StepFinishEvent per step, one StreamEndEvent) and preserves per-step replay metadata. The vendor validated against a real consumer (prism-harness's own suite passes). No breaking changes are claimed in this release, and StreamCollector was the only public class removed since v0.131.0.
Technical risk: Moderate, and mostly process-driven rather than code-driven:
0.x, so SemVer gives no compatibility guarantees; silent removal of public API is a demonstrated failure mode, not a hypothetical.StreamCollector is now deprecated in favour of StreamedMessages::fromEvents(). Deprecation implies eventual removal, and no target version or timeline is stated.Key questions:
StreamCollector, and will that removal be announced in the release notes and changelog?trigger_error/E_USER_DEPRECATED) or only in PHPDoc? This determines whether we can detect usage in CI.StreamedMessages::fromEvents() a strict behavioural equivalent for callback invocation order and per-step metadata, or are there edge cases?0.133.x?Stack fit: Native Composer dependency in a Laravel application. No infrastructure change; the risk is entirely in dependency version management and stream-event consumption code.
Migration path: Two-track.
0.133.1 with a caret constraint bounded below the next minor (~0.133.1 rather than ^0.133), commit the lock file, and avoid unconstrained composer update in CI. This directly closes the failure that hit prism-harness.StreamCollector to StreamedMessages::fromEvents(). The restoration gives us a safe window to do this deliberately rather than reactively.Compatibility: Verified against prism-harness 0.13.0, which is a meaningful independent signal. Constructor, collect() and callback signatures are unchanged, so existing code compiles and runs without modification. Behavioural compatibility of the emitted event stream should be asserted, not assumed.
Sequencing:
0.133.1; confirm CI is green on streaming tests.StepFinishEvent per step, one StreamEndEvent) and replay-metadata presence.StreamCollector so call sites are not coupled to the deprecated symbol.StreamedMessages::fromEvents(); delete the adapter when the class is removed.Maintenance: Low ongoing effort, but real deprecation debt. Budget a small, scheduled task to retire StreamCollector usage; treating it as "fixed forever" is the trap, since the deprecation is explicit and the package is pre-1.0.
Support: Vendor responsiveness is good — the class was restored within a release cycle and validated against a consumer with a regression suite. The concerning signal is the release-notes gap on v0.132.0, which turns routine dependency hygiene into an incident. Escalate as a process question, not a code question; ask for a published changelog policy and a BC-check gate before we deepen dependency.
Scaling: StreamCollector buffers collected messages per stream. Long-running or high-token streams increase memory proportional to accumulated events; per-step replay metadata adds further retained state now that each step emits its own StepFinishEvent. Validate memory behaviour on our largest expected stream before enabling in high-concurrency paths.
Failure modes:
composer update — Class "Prism\Prism\Streaming\StreamCollector" not found at runtime. Highest-impact, lowest-visibility failure; mitigated by pinning plus a lock-file policy.Ramp-up: Low. Single class, small surface (constructor, collect(), one callback), existing documentation and a validated consumer to reference. An engineer familiar with Laravel service providers and event streams can integrate in well under a day; the contract test and adapter are the only non-trivial additions.
How can I help you explore Laravel packages today?