dimitarvp

dimitarvp

Hey everyone,
I am interested in making a tree diff of freshly generated Phoenix projects and projects that have been in development for a while. I’d just like to have it at quick glance what’s the difference from the bare-bones app that would be generated with the Phoenix generator versus the actual app.

To that end, I was unable to find a way to use several different versions of the same Mix archive and be able to specify which version of the archive to use.

In general, Mix archives seems rather awkward to manage and something that regularly catches me with my pants down. I keep forgetting to check for Phoenix’s Mix archive version, but others have bitten me in the past as well. Is there anything we as a community can do to help there, by the way?

And, is there a way to do what I am after? Except for installing a particular version, using it, then deleting it, then installing another etc.?

Showing Posts 1 to 6

NobbZ

NobbZ

You could install each in a different MIX_HOME. And switch to those when using different versions.

dimitarvp

dimitarvp OP

Oh, so this is like Ruby’s gemsets and OCaml’s OPAM’s switches? Cool, at least there’s a good workaround, thank you.

LostKobrakai

LostKobrakai

There‘s https://www.phoenixdiff.org/ for that as well.

dimitarvp

dimitarvp OP

But that’s just comparing different Phoenix versions?

EDIT: I am after comparing a project freshly generated by Phoenix’s generator, and an in-progress project that was earlier generated by the same version of the generator.

dimitarvp

dimitarvp OP

It seems that a little better granularity (and I suppose less file waste) can be achieved by utilizing the MIX_ARCHIVES env var, I’ll experiment and report back.

dimitarvp

dimitarvp OP

Confirmed that using the following commands yields slightly different projects and thus it can be used to “sandbox” using various mix archive-related commands (like phx.new and many others):

MIX_ARCHIVES="$HOME/.mix_phoenix-1.5.5" mix archive.install hex phx_new 1.5.5
mkdir ~/demo155
cd ~/demo155
MIX_ARCHIVES="$HOME/.mix_phoenix-1.5.5" mix phx.new demo

MIX_ARCHIVES="$HOME/.mix_phoenix-1.5.6" mix archive.install hex phx_new 1.5.6
mkdir ~/demo156
cd ~/demo156
MIX_ARCHIVES="$HOME/.mix_phoenix-1.5.6" mix phx.new demo

Doing diff -ur ~/demo155/demo ~/demo156/demo only shows differences between the secret_key_base and signing_salt variables (both irrelevant here) and – voila! – there are differences in mix.exs:

-      {:phoenix, "~> 1.5.5"},
+      {:phoenix, "~> 1.5.6"},

and:

-      {:phoenix_live_dashboard, "~> 0.2"},
+      {:phoenix_live_dashboard, "~> 0.3 or ~> 0.2.9"},

TL;DR: Using the MIX_ARCHIVES env var works perfectly for my goal.

Many thanks to @NobbZ for pointing me in the right direction.

— 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
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
rahultumpala
Hello, I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
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
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews