mickel8

mickel8

Membrane Core Team

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.

Showing Posts 1 to 5

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.

mickel8

mickel8 OP

Membrane Core Team

This sounds resonable but in such a setup you probably have to have some scripts that will automatically compile Phoenix JS source code while compiling your app or you have to do this on your own each time you make any changes to the Pheonix source code.

LostKobrakai

LostKobrakai

There is a watcher in phoenix, it just isn’t coupled to compiling the elixir part.
https://github.com/phoenixframework/phoenix/blob/master/assets/package.json#L40

derek-zhou

derek-zhou

I always use the version under assets/. If phoenix’s client side was written in typescript or purescript, your arguments would make more sense, but it is written in browser safe plain javascript, already usable as it is.

LostKobrakai

LostKobrakai

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

— All posts loaded —

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
water
I’m aware of 2 such projects, are there others? git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
peck
Hi everyone. My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
unaware8150
Hello folks! So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
leoschweizer
Hi, we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
csmr
Hi all, I’m new here and would like to hear peoples views on my Elixir/Phoenix based game-engine! :smiley: Mutonex gamedesign was finish...
New
perzanko
Do we have maintainer of absinthe-graphql/dataloader here? We have a PR that we’d like to merge to the library. Relatively small additive...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews