mickel8

mickel8

Membrane Core Team

How to develop and publish library that combines JavaScript and Elixir code?

Hi,
we have a library that includes server code written in Elixir and client code written in TypeScript - something similar to Phoenix.

We noticed that Phoenix pushes to its repository on GitHub both JS source code in assets/ directory and bundled JS code in priv directory.
The same regarding publishing package on Hex.pm - there are both JS source code and bundled JS code.

Let’s assume I want to debug Pheonix so I clone it and include it in my app in mix.exs using path. Then I change something in Pheonix source code and I want to check if my change make any sense in my application. To do this I have to first compile assets in Phoenix by npm install and then in my app I have to do mix compile. If I forgot to compile JS code in Phoenix I wouldn’t see any changes in my application.

My question is how do you develop Phoenix on the daily baisis and why do you include bundled JS code in priv directory on github instead of e.g. augmenting mix compile task to compile also this JS code.

Most Liked

LostKobrakai

LostKobrakai

This is so people, who do not actively develop the phoenix, don’t need all the required toolchain for building it. The second reason is that phoenix also publishes to npm and the compiled asset is one of its assets. It also gives people a way to just download the compiled file and load it in a website again without needing the toolchain.

It’s far simpler to supply people with the source files and compiled assets – which allows them to either use their own toolchain or non – compared to making people deal with phoenix toolchain and potentially their own as well.

Last Post!

LostKobrakai

LostKobrakai

That’s no longer the case since about a month or so. It’s now written in modern modular javascript.

Where Next?

Popular in Questions Top

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 131117 1222
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
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
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
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

We're in Beta

About us Mission Statement