Updating my fork of Coherence for Phoenix 1.5 and 1.7

Well, I wanted to drop Coherence in one of the developments I’ve in production but it was hard to evolve that from Phoenix 1.4 to Phoenix 1.5, I can see there’s a topic from 2018:

I wasn’t aware of this, I did (like many others) modifications in my fork of coherence to adapt it to Phoenix 1.5, you can see it here:

So, as I said, days ago I had two options:

  1. Drop the whole development of Dymmer and start it from scratch, because it’s awful, it cannot get worse if I start it from scratch, right?
  2. Migrate step by step, dependency to dependency, and part at a time.

I’m not sure about your experiences, but mine are that migrations “all at once” don’t work. You can get a really good brand-new web app doing what you desire, but the old one is working and generating a bit of money, so do you want to jeopardize it?

So, I started migrating to Phoenix 1.7 and the first stop was phoenix_markdown, that library wasn’t updated for longer and the earmark changed a bit, you can see here the changes I made:

Second stop, recaptcha, looks like none was using that for longer, isn’t it? There’s another called HCaptcha that looks like the new kid on the block, well, finally, I made these changes:

And last stop, at the moment, Coherence. Phoenix 1.7 has a new-brand way for auth and even getting solutions like Pow, Coherence was a thing some time ago, but it was abandoned. As I introduced, I made changes for Phoenix 1.5 helped by others who did the same, but looks like most of the people left Coherence and it hasn’t been supported for Phoenix 1.7… until now:

I did this branch for Phoenix 1.7 BUT not using LiveView at the moment, so don’t get too excited, it’s only a way to give me enough time to perform the next steps of the migration for the project.

Maybe I write a bit more about migrations in a future, I’ll let you know :slight_smile:

1 Like

That’s obviously the most pertinent question here, agreed. So why did you start the migration at all? Why need to drop Coherence? :thinking:

With that out of the way, step-by-step migration sounds exhausting and long. But you already started it so maybe that time & energy investment is worth it for you.

Personally I’d start a brand new project and gradually copy all the secret (business) sauce to it. :person_shrugging:

1 Like

Believe me, I tried a couple of times and I have a version of the project non-viable for Phoenix 1.6, and a very nice umbrella project using LiveView and Phoenix 1.7, but still, it’s not working yet. One of the problems isn’t regarding Phoenix or Elixir, one of the most challenging issues is the APIs (like PayPal API v2) but that’s for another different post :smiley:

Briefly, I got a version that’s compiling with Elixir 1.17 and using Phoenix 1.7 right now, in only two days working on that. After that, I’ll need to check if makes sense to make some changes like dropping Coherence finally and getting a brand-new phx.gen.auth… as you said, at the end of the day what matters is getting things done and not fancy.

1 Like

Not quite sure I follow but I’d be interested if you are making separate posts for each problem, and would try to help.

Well, at the moment, the title of the post is “Updating my fork of Coherence for Phoenix 1.5 and 1.7” and it’s done, you can see in the links that I’ve Coherence updated for Phoenix 1.5 and I did it recently for Phoenix 1.7, so if that’s useful for you, it’s the main intention of the post :slight_smile:

On the other hand, my main concern about keeping Coherence is that most people are leaving this development. I’m not sure it’s a good idea to dedicate efforts to investing in it instead of using something that is more maintained by the community (as phx.gen.auth is), so I did it for 1.5 and 1.7. Still, if there are more changes for 1.8 and the following versions of Phoenix, I won’t be there :smiley: (or I hope so)

Ah, no I meant more like if you make separate posts about the separate steps you are taking. I get your bigger goal, was just simply under the impression you’ll break it apart is all.