Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

Things I learned about Phoenix

notebooks/things_i_learned.livemd

Things I learned about Phoenix

Javascript/Typescript integration is so easy

  • npm --save in assets/vendor just works
  • Adding Typescript to assets/js just works
  • Super helpful error messages 😍

> Could not resolve “foo” > > Use the relative path “./foo” to reference the file “js/foo.ts”. Without the leading “./“, > the path “foo” is being interpreted as a package path instead.

  • Live Reload works for JS as well

Untill it isn’t

Lesson: Have seperate project for complex js builds, then import that!

Section

  • phx-update=”ignore” when you want Phoenix to keep away from a DOM element

  • There is a symmetry between the “joined” and “leaved” structure you get in presence_diff messages and stream_delete_by_dom_id and stream_insert

graph TD;
  ?-->Connected;
  A-->C;
  B-->D;
  C-->D;