leandrocp

leandrocp

LiveMonacoEditor - Monaco Editor component for Phoenix LiveView

Hey everyone, live_monaco_editor is a new component to render the Monaco Editor in your app. Monaco is the editor that powers VSCode and is the editor we all use and love in Livebook.

It was created to be used on BeaconCMS Admin UI but it can be used in any app.

How it looks like

After installing the dep and adding its hook into live socket, you can have an editor as simple as:

<LiveMonacoEditor.code_editor value="# My Code Editor" />

And interact with it calling:

socket
|> LiveMonacoEditor.change_language("html")
|> LiveMonacoEditor.set_value("<h1>New File</h1>")

Check out all features. More to come.

How assets are loaded

It’s using monaco-loader to load assets dynamically at runtime keeping the bundle size really small. It may support importing local assets if that’s ever requested.

Is it ready for production?

It’s in the early stages but a new version to make it more stable will be released soon.

Roadmap

The top priority is delivering a great UX for editing Elixir and HEEx files with auto complete and features you’d expect from a code editor, similar to Livebook. Note that this project has no association with Livebook but that’s a source of inspiration thanks to Jonatan Kłosko.

Enjoy!

Most Liked

leandrocp

leandrocp

Hey :wave: quick update since the last post.

Improved look & feel by loading the JetBrains Mono font and OneDark theme by default. That’s how it looks like rendering Elixir code:

And HTML:

Enjoy! New features coming soon.

Exadra37

Exadra37

I am using MD library:

The announcement:

What I am using it for:

leandrocp

leandrocp

Hey @Exadra37 that’s for Beacon and not LiveMonacoEditor but it will be replaced soon. To give you some context, earmark was failing to parse a bunch of markdown files and it won’t be fixed, which is fine since parsing markdown is complex and not all libraries supports all edge cases, so I’ve been experimenting with alternatives and the end goal is to not require an external dependency.

Where Next?

Popular in Announcing Top

josevalim
Yes, yet another parser combinator library! Most of the parser combinators in the ecosystem are either compile-time, often using AST tra...
159 19103 141
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
mplatts
With HEEX released we decided to start a components library using Tailwind CSS - check it out here: Petal Components. We also have a boi...
New
Crowdhailer
I have been updating a library that allows you to pipe between functions that use the erlang result tuple convention. Assuming you have...
New
mbuhot
Leverage Open Api 3.0 (Swagger) to document, test, validate and explore your Plug and Phoenix APIs. Generate and serve a JSON Open API ...
New
bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
384 13673 119
New
hpopp
After just over two years in development, this latest version of Pigeon is what I finally consider done in regards to my original vision ...
New
Hal9000
Here is my first stab at this. README pasted below. https://github.com/Hal9000/elixir_random Comments and critiques are welcome. Th...
New
Qqwy
TypeCheck: Fast and flexible runtime type-checking for your Elixir projects. Core ideas Type- and function specifications are const...
336 14302 100
New
mattludwigs
Grizzly is a library for working with Z-Wave devices. Z-Wave is a low-frequency radio protocol for controlling smart home devices on a me...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 41454 115
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30840 112
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
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
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New

We're in Beta

About us Mission Statement