Weave Code
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

Sidecar Shiki Laravel Package

spatie/sidecar-shiki

Run Shiki syntax highlighting on AWS Lambda via Sidecar from your Laravel app—no Node.js or Shiki dependencies on your server. Install the package, configure Sidecar, register the HighlightFunction, and render highlighted code fast and consistently.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Developer Experience (DX) Enhancements: Accelerate feature delivery for documentation-heavy products (e.g., IDEs, code editors, or developer portals) by eliminating Node.js dependency overhead for syntax highlighting. Reduces friction in integrating high-quality, editor-grade syntax themes without managing complex build pipelines.
  • Cost Optimization: Justify "build vs. buy" for syntax highlighting by avoiding self-hosted Node.js infrastructure (e.g., AWS Lambda costs for Shiki) while maintaining performance. Aligns with serverless architectures where operational overhead is a priority.
  • Roadmap Prioritization: Fast-track features requiring real-time or batch syntax highlighting (e.g., code snippets in API docs, embedded playgrounds, or collaborative coding tools). Enables rapid iteration without blocking on frontend/backend integration.
  • Security/Compliance: Mitigate risks of self-managed Node.js environments (e.g., dependency vulnerabilities) by leveraging Spatie’s maintained package and Sidecar’s serverless isolation.
  • Multi-Language Support: Expand product offerings to support niche or emerging languages (e.g., Rust, Zig) with minimal effort, leveraging Shiki’s broad language engine.

When to Consider This Package

  • Avoid if:
    • Your stack already uses Node.js and Shiki is a lightweight dependency (e.g., frontend-only highlighting). Overhead of Sidecar/Lambda may not justify benefits.
    • You need offline/edge highlighting (e.g., PWA or static sites). Sidecar requires AWS Lambda; consider WASM-based alternatives like @shikijs/vscode-textmate.
    • Performance is critical for large files (>100KB). Test latency with Sidecar’s cold starts vs. local Node.js execution.
    • Your team lacks serverless familiarity. Sidecar adds operational complexity (e.g., Lambda configuration, IAM roles).
  • Look elsewhere if:
    • You need custom themes/plugins beyond Shiki’s defaults. Sidecar abstracts Shiki’s config; deep customization may require forking.
    • Budget constraints exist for AWS Lambda invocations. Estimate costs for expected usage volume (e.g., 1M requests/month).
    • Real-time collaboration requires sub-100ms latency. Sidecar’s cold starts (~100–500ms) may impact UX.

How to Pitch It (Stakeholders)

For Executives:

*"This package lets us deliver editor-grade syntax highlighting—like VS Code’s—without managing Node.js or bloating our servers. By offloading Shiki to AWS Lambda via Sidecar, we:

  • Cut dev ops overhead (no Node.js installs, dependency updates, or scaling).
  • Future-proof our docs/tools with zero effort for new languages/themes.
  • Reduce costs vs. self-hosting Shiki, with predictable Lambda pricing. Example: If we’re building a developer portal with live code snippets, this lets us ship polished UX in weeks, not months. ROI: Faster feature velocity, lower maintenance, and a competitive edge for technical audiences."*

For Engineering:

*"Spatie’s sidecar-shiki wraps Shiki (the same engine as VS Code) in a serverless Lambda function, so we can:

  • Highlight code in PHP/Laravel apps (e.g., API docs, embedded editors) without Node.js.
  • Leverage Sidecar’s caching to reduce Lambda costs for repeated requests.
  • Integrate seamlessly with Laravel via HTTP calls (e.g., Http::post() to Sidecar endpoint). Tradeoffs:
  • Cold starts: ~100–500ms latency (mitigate with provisioned concurrency).
  • Vendor lock-in: AWS Lambda only (but easy to swap if needed). Proposal: Pilot this for [specific feature X], benchmark vs. our current solution, and compare costs. If it meets SLA, we can standardize it for all code-related highlighting."*

Key Metric to Track: Time saved on syntax-highlighting integration vs. Lambda costs per 1M requests.

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport