markevans

markevans

Komodo - easily render React, Svelte, Vue, Angular, any JS framework component from Liveview

Hi there!

I’ve created a small library, Komodo, that allows easy use of JS framework components from Phoenix LiveView.

Each framework just needs a small piece of easy-to-write Javascript adapter code to work with it (this is already provided for React, Svelte, Vue and Web Components).

komodo-short

Rationale

There are a few libraries already out there for rendering JS components (for React, Svelte, etc.) from LiveView, however I personally wanted a few things which they all seemed to be missing:

  • A standard interface for interacting with different frameworks
  • To be truly reusable, JS components should have no knowledge of LiveView (many other libraries require them to know about pushEvent) - with this separation it’s now easy to drop in third-party reusable components without needing to wrap them in a LiveView-aware wrapper
  • separation between a) compiling the component into JS and b) actually using the component (other libraries do both things for you) - you may not even want to compile, say, Svelte components if you’re only pulling in third-party ones
  • easily use components from different frameworks in the same app

This is a fairly simple first pass, but to be honest I’m not sure if anything more complicated is needed.
For example, currently all props are sent down the wire when a prop is changed, but to send only the prop that changed down the wire we’d need to keep more state in memory in the LiveView process, which may be a worse trade-off if there are many users. Something to think about for the future anyway.

Please let me know if you have any feedback!
Links below - thanks!

Mark

Most Liked

juliolinarez

juliolinarez

I’ve only just found this library. I tried to do the same from the scratch. Looks awesome ! Thanks

Where Next?

Popular in Libraries Top

mhanberg
I just released the first version of Temple: an HTML DSL for Elixir and Phoenix! You can read this blog post or the docs for more info...
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
Jskalc
Hi! Today, after a couple weeks of development I’ve released v0.1 of LiveVue. It’s a seamless integration of Vue and Phoenix LiveView, i...
New
benlime
I created a new library GitHub - benvp/ex_cva: Class Variance Authority for Elixir which aims to make it very easy to define different va...
New
Qqwy
TypeCheck: Fast and flexible runtime type-checking for your Elixir projects. Core ideas Type- and function specifications are const...
336 13801 100
New
mcrumm
If you would like to migrate away from node/npm/webpack while still using sass, the dart_sass package provides a installer and runner for...
New
devonestes
Introducing assertions, the library that helps you write really great test assertions! GitHub: https://github.com/devonestes/assertions ...
New
seancribbs
Today I released a new dialyzer Mix task as the dialyzex package! At the time we started writing this task, the existing dialyzer integra...
New
woutdp
Hi! I wanted to introduce my latest project LiveSvelte. It allows you to render Svelte inside LiveView with end-to-end reactivity. It’s ...
New
mtrudel
Bandit is an HTTP server for Plug and WebSock apps. Bandit is written entirely in Elixir and is built atop Thousand Island. It can serve...
New

Other popular topics Top

TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

Sub Categories:

We're in Beta

About us Mission Statement