actnforchildren / mental_health_app

Tiffany Tang's mental health app working with Dwyl.com
https://actnforchildren.herokuapp.com/
7 stars 0 forks source link

Integrate Elm with Phoenix #35

Closed SimonLab closed 5 years ago

SimonLab commented 5 years ago

linked to #12

Elm can be used to display and managing the state of the calendar instead of using vanilla js.

read:

SimonLab commented 5 years ago

image

(I think now elm is available via npm)

update the Dockerfile to install elm:

...  
  && mix local.rebar --force \
  && wget "https://github.com/elm/compiler/releases/download/0.19.0/binaries-for-linux.tar.gz" \
  && tar xzf binaries-for-linux.tar.gz \
  && mv elm /usr/local/bin/

Run docker-compose build to rebuild the image and install elm Test elm is installed with docker-compose run --rm app elm --version

Phoenix 1.3 is using Brunch to manage assets see https://phoenixframework.org/blog/static-assets Phoenix 1.4 will use Webpack instead of brunch: image

To manage/compile the new elm code we need to install and configure elm-brunch:

Update the owner of the elm folder: sudo chown -R $USER:$USER assets/elm/

Now as soon as you modify the elm code, brunch will compile it to elm.js file image

SimonLab commented 5 years ago

Implemented with #40