Things I learned about Phoenix
Javascript/Typescript integration is so easy
-
npm --save
inassets/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
andstream_insert
graph TD;
?-->Connected;
A-->C;
B-->D;
C-->D;