Skip to content
Permalink
Branch: main
Commits on May 18, 2019
  1. Make win/lose bigger

    aforward committed May 18, 2019
Commits on Apr 14, 2019
  1. Go back to pheonix liveview master

    aforward committed Apr 12, 2019
    There was an issue, documented here
    phoenixframework/phoenix_live_view#148
    
    Where the following exception was made
    
    ```
    [error] GenServer #PID<0.403.0> terminating
    ** (FunctionClauseError) no function clause matching in Phoenix.LiveView.Channel.log_mount/2
        (phoenix_live_view) lib/phoenix_live_view/channel.ex:179: Phoenix.LiveView.Channel.log_mount(%Phoenix.Socket{assigns: %{}, channel: Phoenix.LiveView.Channel, channel_pid: nil, endpoint: HangmanWeb.Endpoint, handler: Phoenix.LiveView.Socket, id: nil, join_ref: "118", joined: false, private: %{}, pubsub_server: Hangman.PubSub, ref: nil, serializer: Phoenix.Socket.V2.JSONSerializer, topic: "lv:phx-gvdrSfdsJvM=", transport: :websocket, transport_pid: #PID<0.388.0>}, #Function<0.76975216/0 in Phoenix.LiveView.Channel.join/1>)
        (phoenix_live_view) lib/phoenix_live_view/channel.ex:201: Phoenix.LiveView.Channel.join/1
        (stdlib) gen_server.erl:637: :gen_server.try_dispatch/4
        (stdlib) gen_server.erl:711: :gen_server.handle_msg/6
        (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
    Last message: {:join, Phoenix.LiveView.Channel}
    State: {%{"session" => "SFMyNTY.g3QAAAACZAAEZGF0YW0AAACQZzNRQUFBQUVaQUFDYVdSdEFBQUFFSEJvZUMxbmRtUnlVMlprYzBwMlRUMWtBQXB3WVhKbGJuUmZjR2xrWkFBRGJtbHNaQUFIYzJWemMybHZiblFBQUFBQVpBQUVkbWxsZDJRQUlFVnNhWGhwY2k1RmJYQmxlR3h2WjI5WFpXSXVVR0ZuWlV4cGRtVldhV1YzZAAGc2lnbmVkbgYASa3q1GkB.KbYipUCr9C0AFzDFSDPrJYhg1bWvMzopJW6YtE8wqCA"}, {#PID<0.388.0>, #Reference<0.3363977473.1562378243.177672>}, %Phoenix.Socket{assigns: %{}, channel: Phoenix.LiveView.Channel, channel_pid: nil, endpoint: HangmanWeb.Endpoint, handler: Phoenix.LiveView.Socket, id: nil, join_ref: "118", joined: false, private: %{}, pubsub_server: Hangman.PubSub, ref: nil, serializer: Phoenix.Socket.V2.JSONSerializer, topic: "lv:phx-gvdrSfdsJvM=", transport: :websocket, transport_pid: #PID<0.388.0>}}
    [error] an exception was raised:
        ** (FunctionClauseError) no function clause matching in Phoenix.LiveView.Channel.log_mount/2
            (phoenix_live_view) lib/phoenix_live_view/channel.ex:179: Phoenix.LiveView.Channel.log_mount(%Phoenix.Socket{assigns: %{}, channel: Phoenix.LiveView.Channel, channel_pid: nil, endpoint: HangmanWeb.Endpoint, handler: Phoenix.LiveView.Socket, id: nil, join_ref: "118", joined: false, private: %{}, pubsub_server: Hangman.PubSub, ref: nil, serializer: Phoenix.Socket.V2.JSONSerializer, topic: "lv:phx-gvdrSfdsJvM=", transport: :websocket, transport_pid: #PID<0.388.0>}, #Function<0.76975216/0 in Phoenix.LiveView.Channel.join/1>)
            (phoenix_live_view) lib/phoenix_live_view/channel.ex:201: Phoenix.LiveView.Channel.join/1
            (stdlib) gen_server.erl:637: :gen_server.try_dispatch/4
            (stdlib) gen_server.erl:711: :gen_server.handle_msg/6
            (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
    ```
    
    I pushed a fix, but I was addresses the symptom
    
    ```
    This change addresses the symptom, I am not sure if there's a separate change that I need
    to make to avoid adding a second :noop match.
    ```
    
    The right fix was made
    
    phoenixframework/phoenix_live_view@13a0ab8
    
    I must admit, I do not understand the full extend of changing join/mount, but it works!!!
  2. Temporary use local phoenix_live_view while exception is being thrown

    aforward committed Apr 12, 2019
    There's an exception being raised.  I created a PR to fix the symptom,
    and will wait for more information on the correct way to address this.
    
    phoenixframework/phoenix_live_view#148
  3. Form liveview

    aforward committed Apr 12, 2019
  4. Start each game refresh

    aforward committed Apr 12, 2019
  5. Move controller to liveview

    aforward committed Apr 12, 2019
  6. Setup phoenix to support LiveView

    aforward committed Apr 12, 2019
    Don't forget to install the npm packages
    
    phoenixframework/phoenix_live_view#74
    
    ```
    npm install --prefix assets
    ```
  7. Install phoenix_live_view

    aforward committed Apr 12, 2019
  8. Implement basic hangman UI

    aforward committed Apr 12, 2019
  9. Implement the hangman model and diet rules

    aforward committed Apr 12, 2019
    Based on a talk by Dave Thomas
    Transforming Programming
    https://www.youtube.com/watch?v=A76hM3MpEKo
    
    And using slides found here
    http://www.yowconference.sg/slides/yowhongkongsingapore2017/Thomas-BestOOLanguageFunctional.pdf
    
    I implemented the hangman game
  10. Remove phoenix defaults

    aforward committed Apr 12, 2019
  11. $ mix phx.new hangman --no-ecto

    aforward committed Apr 12, 2019
    The directory /tmp/hangman already exists. Are you sure you want to continue? [Yn] Y
    * creating hangman/config/config.exs
    * creating hangman/config/dev.exs
    * creating hangman/config/prod.exs
    * creating hangman/config/prod.secret.exs
    * creating hangman/config/test.exs
    * creating hangman/lib/hangman/application.ex
    * creating hangman/lib/hangman.ex
    * creating hangman/lib/hangman_web/channels/user_socket.ex
    * creating hangman/lib/hangman_web/views/error_helpers.ex
    * creating hangman/lib/hangman_web/views/error_view.ex
    * creating hangman/lib/hangman_web/endpoint.ex
    * creating hangman/lib/hangman_web/router.ex
    * creating hangman/lib/hangman_web.ex
    * creating hangman/mix.exs
    * creating hangman/README.md
    hangman/README.md already exists, overwrite? [Yn] Y
    * creating hangman/.formatter.exs
    * creating hangman/.gitignore
    hangman/.gitignore already exists, overwrite? [Yn] Y
    * creating hangman/test/support/channel_case.ex
    * creating hangman/test/support/conn_case.ex
    * creating hangman/test/test_helper.exs
    * creating hangman/test/hangman_web/views/error_view_test.exs
    * creating hangman/lib/hangman_web/gettext.ex
    * creating hangman/priv/gettext/en/LC_MESSAGES/errors.po
    * creating hangman/priv/gettext/errors.pot
    * creating hangman/lib/hangman_web/controllers/page_controller.ex
    * creating hangman/lib/hangman_web/templates/layout/app.html.eex
    * creating hangman/lib/hangman_web/templates/page/index.html.eex
    * creating hangman/lib/hangman_web/views/layout_view.ex
    * creating hangman/lib/hangman_web/views/page_view.ex
    * creating hangman/test/hangman_web/controllers/page_controller_test.exs
    * creating hangman/test/hangman_web/views/layout_view_test.exs
    * creating hangman/test/hangman_web/views/page_view_test.exs
    * creating hangman/assets/webpack.config.js
    * creating hangman/assets/.babelrc
    * creating hangman/assets/css/app.css
    * creating hangman/assets/css/phoenix.css
    * creating hangman/assets/js/app.js
    * creating hangman/assets/js/socket.js
    * creating hangman/assets/package.json
    * creating hangman/assets/static/robots.txt
    * creating hangman/assets/static/images/phoenix.png
    * creating hangman/assets/static/favicon.ico
    
    Fetch and install dependencies? [Yn] Y
    * running mix deps.get
    * running mix deps.compile
    * running cd assets && npm install && node node_modules/webpack/bin/webpack.js --mode development
    
    We are almost there! The following steps are missing:
    
        $ cd hangman
    
    Start your Phoenix app with:
    
        $ mix phx.server
    
    You can also run your app inside IEx (Interactive Elixir) as:
    
        $ iex -S mix phx.server
Commits on Apr 12, 2019
  1. Initial commit

    aforward committed Apr 12, 2019
You can’t perform that action at this time.