woutdp/live_svelte
56.3
Adequate · 13 November 2026
6.9k
lines of production code
Elixir
with JavaScript, TypeScript
8
measurements over time
What this system is
LiveSvelte is an Elixir library that integrates Svelte components into Phoenix LiveView applications, enabling seamless client-side interactivity and server-side rendering. It provides a modern integration layer featuring Svelte 5 runes, composable hooks for navigation and events, and optimized prop diffing via JSON Patch. The system supports flexible SSR backends, including Vite.js and Node.js, and includes a comprehensive example project to demonstrate real-time features like chat, drag-and-drop, and form validation.
Features
Add Advanced Chat example using Svelte runes and LiveView integration
A new advanced chat example has been added to the examples/advanced\_chat directory, demonstrating a real-time chat interface built with Svelte and Phoenix LiveView. The Svelte component (AdvancedChat.svelte) utilizes Svelte 5 runes ($props, $state, $effect) for reactive state management and transitions, while the LiveView module (live\_svelte.ex) handles user name assignment and broadcasts messages via Phoenix PubSub. The example showcases passing a live hook via the live prop to enable client-side event pushing (live.pushEvent) for sending messages.
_examples/advanced\_chat, examples/simple\chat · high confidence
Add Breaking News and Animated Number examples using Svelte runes and live hook pattern
The examples/breaking\_news directory now includes two new interactive examples: a Breaking News ticker and an Animated Number counter. These examples demonstrate the updated integration pattern where the Svelte component receives a \live\ prop (containing \pushEvent\) instead of using \pushEvent\/\pushEventTo\ directly, and utilizes Svelte runes (e.g., \$props\, \$state\) for reactivity. The Breaking News example features a marquee that allows users to add, remove, and adjust the speed of news items, while the Animated Number example shows a counter with fly transitions.
_examples/breaking\news · high confidence
Add example Phoenix project with LiveSvelte integration
Added the initial structure for the example Phoenix application, including the main Example module and the ExampleWeb module. The ExampleWeb module sets up standard Phoenix web components (controllers, live views, components) and explicitly imports the LiveSvelte library within its HTML helpers, enabling the use of Svelte components in Phoenix LiveView templates.
_example\project/lib · high confidence
Add example project configuration for LiveSvelte with Vite and SSR
The example project now includes a complete configuration setup (config.exs, dev.exs, prod.exs, test.exs, runtime.exs) to support LiveSvelte integration with Vite. This enables server-side rendering (SSR) in development and production using ViteJS and NodeJS respectively, while disabling SSR in the test environment to ensure client-side testing accuracy. The configuration also sets up the Phoenix endpoint with Bandit adapter, configures Ecto repositories for SQLite, and integrates Wallaby and PhoenixTest for E2E and server-side testing.
_example\project/config · high confidence
Add example project with LiveSvelte SSR support
The example project now includes a client-side entry point (app.js) that initializes Phoenix LiveView with LiveSvelte hooks, featuring active link highlighting, a navigation drawer filter, and a props-diff display component. Additionally, a new server-side entry point (server.mjs) has been added to enable Server-Side Rendering (SSR) for LiveSvelte components, addressing a memory leak issue previously associated with the SSR implementation.
_example\project/assets/js · high confidence
Add simple dead view example
Added a new example in the \examples/simple\_dead\_view\ directory demonstrating a basic Svelte component integration. The example includes a \Simple.svelte\ file rendering "Hello World" and a \simple.html.heex\ template that mounts it using the \LiveSvelte\ component.
_examples/simple\_dead\view · high confidence
Add store integration examples
Added example files demonstrating how to use Svelte stores within LiveSvelte components. This includes a shared JavaScript store implementation, two Svelte component examples that bind to the store, and two Elixir LiveView modules that render these components, allowing users to see how state management works in this context.
examples/store · high confidence
Added core UI components and navigation layout for the example project
The example project now includes a set of reusable UI components and a structured navigation system. Core components such as a modal dialog and a demo page wrapper (supporting standard and compact variants) are available in \core\_components.ex\. Additionally, \layouts.ex\ introduces a main navigation structure with sidebar and desktop dropdown menus, organizing example demos into categories like Basics, Interactive, Data, Slots, Advanced, Ecto, and Composables.
_example\_project/lib/example\web/components · high confidence
Expanded example project with new LiveView demos
The example project in example\_project/lib/example\_web/live has been significantly expanded with numerous new LiveView modules demonstrating various LiveSvelte capabilities. New demos include breaking news with a marquee ticker, real-time chat, client-side loading with loading slots, component composition using useLiveSvelte(), drag-and-drop reordering, a rich text editor using @attach, event replies, form validation with Ecto changesets, ID-based list diffing, light bulb controller, log list, client-side navigation, OTP-based notes with PubSub, plus/minus counters, props diffing, runed utilities, the \~V sigil for inline Svelte templates, simple counters, dynamic and simple slots, SSR demos, static color components, and Svelte stores. These additions provide comprehensive examples for users to understand and implement LiveSvelte features in their own applications.
_example\_project/lib/example\web/live · high confidence
Initial example project scaffolding
Adds a new example Phoenix application demonstrating LiveSvelte integration, including a Dockerfile for containerized builds, a .gitignore tailored for Svelte and Phoenix artifacts, and formatter configurations for Elixir and Ecto migrations.
_example\project · high confidence
Initial example project scaffolding with SQLite and LiveSvelte SSR
Adds a new Phoenix-based example application in \example\_project/lib/example\ that demonstrates LiveSvelte integration. The project is configured to use SQLite via Ecto (defined in \repo.ex\) and includes a sample \Note\ schema and context to showcase data handling. It also sets up the OTP application supervision tree (\application.ex\) to initialize the LiveSvelte Node.js SSR environment and includes a release task (\release.ex\) for running database migrations in production.
_example\project/lib/example · high confidence
Initial example project web layer scaffolding
The example project now includes a complete Phoenix web layer, providing the foundational structure for the demonstration application. This includes error handling templates for HTML and JSON responses, a router defining routes for various LiveView examples (such as counters, drag-and-drop, and forms) alongside static pages, and an endpoint configuration that integrates PhoenixVite for asset management and enables LiveDashboard in development. Additionally, standard modules for internationalization (Gettext) and application telemetry metrics are established to support observability and localization within the example.
_example\_project/lib/example\web · high confidence
LiveSvelte adds composables, navigation, and streaming support
LiveSvelte introduces a suite of Svelte composables (useLiveSvelte, useLiveEvent, useLiveConnection, useLiveNavigation) that allow components to access the Phoenix hook context and perform client-side navigation without prop drilling. It adds a Link component for LiveView patch and navigate actions, implements JSON Patch (RFC 6902) for efficient props and stream updates, and includes useLiveForm and useEventReply for handling forms and request-response events.
_assets/js/live\svelte · high confidence
New example project showcasing LiveSvelte capabilities
The example\_project/assets/svelte directory now contains a comprehensive suite of Svelte components demonstrating LiveSvelte integration. These examples cover core features such as live navigation, component composition, and props diffing, alongside advanced patterns like live form validation via Ecto changesets, event replies, and shared store synchronization. The collection also includes interactive demos for drag-and-drop, rich text editing with Editor.js, debounced search, and keyboard shortcuts, providing a practical reference for building real-time Svelte applications with Phoenix LiveView.
_example\project/assets/svelte · high confidence
New example project with Svelte 5 demo layout
The example project now includes a dedicated layout structure for showcasing LiveSvelte components. The root layout (\root.html.heex\) integrates Phoenix Vite to serve assets and applies a 'livesvelte' theme, while the application layout (\app.html.heex\) provides a responsive UI with a mobile drawer, navigation sidebar, and search filtering to help users browse and interact with the various Svelte 5 examples.
_example\_project/lib/example\web/components/layouts · high confidence
New example project with Svelte integration demos
The example project now includes a dedicated page layout that showcases various ways to integrate Svelte components with Phoenix LiveView. Users can explore examples covering basics like simple component rendering and npm package usage, interactive features such as counters and drag-and-drop, data handling with real-time updates and props diffing, slot usage, and advanced topics like SSR and client-side loading. Specific pages demonstrate rendering Svelte components with different props, including a basic hello world, a lodash utility example, and a static plus/minus counter.
_example\_project/lib/example\_web/controllers/page\html · high confidence
New example project with Tailwind CSS and DaisyUI styling
The example project now includes a dedicated CSS configuration that sets up a modern UI using Tailwind CSS and the DaisyUI component library. The \app.css\ file defines a custom 'livesvelte' theme with specific color palettes, typography (Plus Jakarta Sans and DM Sans), and utility classes for headers, cards, and navigation menus. Additionally, a custom Tailwind plugin (\hero-icons-plugin.js\) is introduced to automatically generate utility classes for Heroicons SVGs, allowing users to easily integrate icons into the example application.
_example\project/assets/css · high confidence
Removals
Removal of legacy Svelte SSR render helper
The \assets/svelte/render.js\ file, which previously provided a CommonJS wrapper to load and render Svelte components for Server-Side Rendering, has been removed. This eliminates the manual \require\-based entry point for SSR, aligning with the project's refactored approach to handling SSR and slots.
assets/svelte · high confidence
Removal of legacy Svelte integration hooks and entry points
The legacy JavaScript infrastructure for integrating Svelte components with Phoenix LiveView has been removed. Specifically, the \assets/js/app.js\ entry point, the \assets/js/hooks.js\ file containing the \SvelteComponent\ hook logic (which handled component mounting, props parsing, and navigation via \goto\), and the \assets/js/server.js\ file for server-side rendering have all been deleted. This eliminates the previous mechanism for dynamically loading and hydrating Svelte components within LiveView pages.
assets/js · high confidence
Behavioural changes
Added Svelte configuration and TypeScript support for the example project
The example project now includes configuration files to support Svelte with TypeScript and live-reload capabilities. A new svelte.config.js enables preprocessing via vitePreprocess, while tsconfig.json sets up TypeScript compilation with path aliases for $lib. The vite.config.mjs file configures the build process, integrating the live\_svelte plugin for server-side updates, Tailwind CSS, and specific SSR build outputs (.mjs files) to address memory leak issues.
_example\project/assets · high confidence
Default SSR configuration and test coverage settings
The application now includes default configuration for LiveSvelte's server-side rendering, enabling SSR by default and specifying the NodeJS module and server file path. Additionally, test coverage requirements are set to a minimum of 87%.
config · high confidence
Installer migrated to Igniter and PhoenixVite
The LiveSvelte installation process has been completely rewritten to use the Igniter framework and PhoenixVite, replacing the previous manual setup tasks (configure\_phoenix, configure\_esbuild, install\_npm\_deps). The new \live\_svelte.install\ task automatically configures Vite, Tailwind, and SSR settings, updates the JavaScript hooks in \assets/js/app.js\, and injects the LiveSvelte import into the project's HTML helpers, providing a more robust and automated integration experience.
lib/mix · high confidence
Major component architecture overhaul with Vite support and prop diffing
The library has been refactored to replace the previous LiveComponent-based rendering with a new Phoenix.Component-based \LiveSvelte.svelte/1\ macro, which improves developer experience and resolves slot validation issues by overriding Phoenix's component checks. This change introduces granular control over server-side rendering (SSR) via a new \ssr\ attribute, adds a \:loading\ slot for client-side fallbacks, and implements JSON Patch-based prop diffing to optimize network payloads during updates. Additionally, a new \LiveSvelte.Reload\ component provides seamless integration with the Vite dev server for hot-module reloading in development, while the old \LiveSvelte.render/1\ function is deprecated in favor of the new \svelte/1\ interface.
lib · high confidence
Migrate asset build tooling from esbuild to Vite and TypeScript
The asset build pipeline has been reconfigured to use Vite and Vitest instead of the previous esbuild-based setup. The old build script (build.js) and Tailwind configuration (tailwind.config.js) have been removed, replaced by a new Vite configuration (vitest.config.js) that sets up the jsdom test environment and code coverage, alongside a TypeScript configuration (tsconfig.json) targeting ES2020. This change enables native TypeScript support for the assets and shifts the testing framework to Vitest.
assets · high confidence
New JSON encoding architecture with configurable libraries and improved SSR data handling
LiveSvelte now uses a new \LiveSvelte.Encoder\ protocol to transform Elixir terms into JSON-compatible structures before serialization, supporting \@derive\ options to control which struct fields are included. The default JSON encoder is Erlang/OTP 27's native \:json\ module (via \LiveSvelte.JSON\), which can be swapped for a custom library like Jason via configuration. This change also ensures that \nil\ values are preserved as \null\ during SSR data preparation, preventing them from being incorrectly serialized as strings in the Node.js worker.
_lib/live\svelte · high confidence
New Vite.js SSR backend and refactored Node.js implementation
The SSR layer now supports two distinct backends: a new Vite.js implementation (LiveSvelte.SSR.ViteJS) that renders components by POSTing to a local Vite dev server, and a refactored Node.js implementation (LiveSvelte.SSR.NodeJS) that uses ESM imports to avoid memory leaks. Users can switch between these by configuring the :ssr\_module option, with Node.js remaining the default for backward compatibility.
lib/ssr · high confidence
Svelte components now use runes and receive a live hook via props
Svelte components in the examples have been migrated to use Svelte runes ($props, $state) instead of legacy exports, and the mechanism for communicating with the LiveView backend has changed: components no longer receive a standalone pushEvent function but instead accept a live hook object via the live prop, calling live.pushEvent for events. This is demonstrated in the Simple component, which now uses $props to destructure number and live, and the LogList component, which similarly uses $props and live.pushEvent to add items.
examples/simple · high confidence
Test coverage
Added E2E tests for LiveView and Svelte integration examples; Added PhoenixTest coverage for example LiveView demos; Added comprehensive test coverage for LiveSvelte core features; Added integration tests for LiveSvelte SSR functionality; Added test infrastructure and initial test coverage for the example project.
Dependencies
Major dependency upgrades and example project modernization
The project has upgraded its core Elixir dependencies to require Elixir 1.17+ and Phoenix LiveView 1.0+, while adding support for Phoenix 1.7+ and Phoenix HTML 4.1+. The example project has been modernized to use Phoenix Vite for asset management, upgraded to Svelte 5, and now includes TypeScript support. Additionally, the main library's development tooling has been updated with newer versions of ExDoc, Credo, and Dialyxir, and the example project now demonstrates integration with Editor.js and Runed.
(dependencies) · high confidence
Housekeeping
Project infrastructure and code quality tooling added
Added configuration files for Credo and Dialyzer to enforce code quality standards, along with Prettier for frontend formatting. Introduced a Nix flake to standardize the development environment with Erlang 27, Elixir 1.18, and Node.js 22. Updated the Elixir formatter to include Phoenix LiveView HTML formatting and refined the .gitignore to exclude new build artifacts and tooling directories.
(repo-wide) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 52 → 56 (+4.5)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.
Lenses
- Code Health 61 → 70 (+9.7)
- Architecture 98 → 98 (-0.5)
- Maturity 61 → 61 (+0.0)
- Readiness 39 → 43 (+3.1)
- Security 82 → 98 (+15.9)
- Accessibility 55 → 63 (+7.4)
- Performance 100 → 100 (+0.0)
Resolved (14)
- High CVE: [GHSA redacted] (assets/package-lock.json)
- High CVE: [GHSA redacted] (example_project/package-lock.json)
- High CVE: [GHSA redacted] (example_project/package-lock.json)
- Leaked secret: high-entropy-secret (example_project/config/dev.exs)
- Leaked secret: high-entropy-secret (example_project/config/test.exs)
- Leaked secret: signing-key (example_project/config/dev.exs)
- Leaked secret: signing-key (example_project/config/test.exs)
- Low coverage: assets/js/live_svelte/composables.ts (assets/js/live_svelte/composables.ts)
- Low coverage: assets/js/live_svelte/render.ts (assets/js/live_svelte/render.ts)
- Low coverage: assets/js/live_svelte/useEventReply.ts (assets/js/live_svelte/useEventReply.ts)
- Low coverage: assets/js/live_svelte/useLiveForm.ts (assets/js/live_svelte/useLiveForm.ts)
- Low coverage: assets/js/live_svelte/useLiveUpload.ts (assets/js/live_svelte/useLiveUpload.ts)
- Off-boarding risk: anonymized user #1
- The sync method exists in both form and upload composables with identical intent (replacing internal state with new external data), but the parameter types differ (Form<T> vs UploadConfig). While the types are distinct domain objects, the naming and signature pattern are consistent. However, UseLiveFormReturn also exposes initialValues as a property, whereas UseLiveUploadReturn does not expose a similar initialConfig property, creating a slight asymmetry in how initial state is exposed vs updated.
New (26)
- Edited copy of a member (2 corresponding lines) (example_project/lib/example_web/live/live_breaking_news.ex)
- Edited copy of a member (2 corresponding lines) (example_project/lib/example_web/live/live_log_list.ex)
- Edited copy of a member (3 corresponding lines) (example_project/lib/example_web/live/live_breaking_news.ex)
- High CVE: [GHSA redacted] (example_project/package-lock.json)
- High CVE: [GHSA redacted] (assets/package-lock.json)
- High CVE: [GHSA redacted] (example_project/package-lock.json)
- High CVE: [GHSA redacted] (example_project/package-lock.json)
- High CVE: [GHSA redacted] (example_project/package-lock.json)
- High CVE: [GHSA redacted] (example_project/package-lock.json)
- High CVE: [GHSA redacted] (example_project/package-lock.json)
- Low CVE: [GHSA redacted] (example_project/package-lock.json)
- Medium CVE: EEF-[CVE redacted] (example_project/mix.lock)
- Medium CVE: EEF-[CVE redacted] (example_project/mix.lock)
- Medium CVE: EEF-[CVE redacted] (example_project/mix.lock)
- Medium CVE: EEF-[CVE redacted] (example_project/mix.lock)
- Medium CVE: EEF-[CVE redacted] (mix.lock)
- Medium CVE: EEF-[CVE redacted] (assets/package.json)
- Medium CVE: [GHSA redacted] (example_project/package-lock.json)
- Medium CVE: [GHSA redacted] (example_project/package-lock.json)
- Medium CVE: [GHSA redacted] (example_project/package-lock.json)
- …and 6 more
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
woutdp/live_svelte was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 767b2d7c728c8ebd4eb870a233aa0cb0d16ad895 — the exact code this score is about.
- Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.57+preprod-8ebfb01cf4c0.