mickel8
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
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
That’s no longer the case since about a month or so. It’s now written in modern modular javascript.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









