Skip to content

my journal for making a phoenix live view generator rough draft. (I have no idea how to do this.)

Notifications You must be signed in to change notification settings

md-web-app/getting-started-with-live-view-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Lets try to make a live view generator

this repository will be a journal as I read through phoenix's installer/lib and installer/templates folders and try to make a rough draft of the live view phoenix generator.

Some pre-existing research that I have done lives in the following repositories: https://github.com/MichaelDimmitt/live_view_app

Docs:

The incredibly long readme that gives the live view 101: https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html

Steps in order of difficulty

  1. define some commands and their expected behavior. a. add live view into the project with no implementation but correct javascript. b. live view folder and with live view component to be added to a regular project. c. scaffold an entire live view project ... phx.new style. (hard)
Next, decide where you want to use your (LiveView)[https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html].
    1) serve the LiveView directly from your router. (recommended)
    2) You can also live_render from any template.
    3) Or you can live_render your view from any controller.

Note: (Live EEx) or ~L sigil. They are similar to regular .eex templates except they
are designed to minimize the amount of data sent over the wire by splitting static 
and dynamic parts and tracking changes.
  1. make a template folder and build templates that use application name. (example)[https://github.com/phoenixframework/phoenix/blob/master/installer/templates/phx_web/views/page_view.ex]
  files for: "hook everything up except the front-end ui": [#1](https://github.com/MichaelDimmitt/live_view_app/pull/1)

  README.md

  // essential files to change for hooking up live view.
  mix.exs
  config/config.exs
  assets/js/app.js
  assets/package.json

  // essential files for a live view change.
  
  lib/live_view_app_web/router.ex 
  lib/live_view_app_web/templates/layout/app.html.eex 

  // files for thermostat and weather live view.
  lib/live_view_app_web/live/thermostat_live.ex 
  lib/live_view_app_web/live/weather_live.ex 

  assets/css/app.css 
  assets/css/live_view.css 
  assets/css/thermostat.css 

About

my journal for making a phoenix live view generator rough draft. (I have no idea how to do this.)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published