Skip to content

Commit d041332

Browse files
committed
Phoenix v1.6.2 update
Updated to Phoenix 1.6.2; going to push changes to my repo then follow the README guide to see if I can replicate the error mentioned in issue #48 on the main repo so I can address it
1 parent 6beb856 commit d041332

File tree

21 files changed

+122
-8644
lines changed

21 files changed

+122
-8644
lines changed

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=lf
2+
*.{cmd,[cC][mM][dD]} text eol=crlf
3+
*.{bat,[bB][aA][tT]} text eol=crlf

.github/workflows/ci.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Elixir CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
name: Build and test
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Elixir
16+
uses: erlef/[email protected]
17+
with:
18+
elixir-version: '1.12.3' # Define the elixir version [required]
19+
otp-version: '24.0.2' # Define the OTP version [required]
20+
- name: Restore dependencies cache
21+
uses: actions/cache@v2
22+
with:
23+
path: deps
24+
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
25+
restore-keys: ${{ runner.os }}-mix-
26+
- name: Install dependencies
27+
run: mix deps.get
28+
- name: Run Tests
29+
run: mix coveralls.json
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
MIX_ENV: test
33+
# AUTH_API_KEY: 2PzB7PPnpuLsbWmWtXpGyI+kfSQSQ1zUW2Atz/+8PdZuSEJzHgzGnJWV35nTKRwx
34+
- name: Upload coverage to Codecov
35+
uses: codecov/codecov-action@v1

.gitignore

+5-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ npm-debug.log
2020
# The directory NPM downloads your dependencies sources to.
2121
/assets/node_modules/
2222

23-
# Since we are building assets from assets/,
24-
# we ignore priv/static. You may want to comment
25-
# this depending on your deployment strategy.
26-
/priv/static/
23+
# Ignore assets that are produced by build tools.
24+
/priv/static/assets/
25+
26+
# Ignore digested assets cache.
27+
/priv/static/cache_manifest.json

.travis.yml

-17
This file was deleted.

README.md

+4-65
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Phoenix LiveView Counter Tutorial
44

5-
[![Build Status](https://img.shields.io/travis/dwyl/phoenix-liveview-counter-tutorial/master.svg?style=flat-square)](https://travis-ci.org/dwyl/phoenix-liveview-counter-tutorial)
5+
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/dwyl/phoenix-liveview-counter-tutorial/Elixir%20CI?label=build&style=flat-square)
66
[![codecov.io](https://img.shields.io/codecov/c/github/dwyl/phoenix-liveview-counter-tutorial/master.svg?style=flat-square)](http://codecov.io/github/dwyl/phoenix-liveview-counter-tutorial?branch=master)
77
[![Hex pm](http://img.shields.io/hexpm/v/phoenix_live_view.svg?style=flat-square)](https://hex.pm/packages/phoenix_live_view)
88
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat-square)](https://github.com/dwyl/phoenix-liveview-counter-tutorial/issues)
@@ -98,10 +98,10 @@ elixir -v
9898
You should expect to see output similar to the following:
9999

100100
```elixir
101-
Elixir 1.10.4 (compiled with Erlang/OTP 23)
101+
Elixir 1.12.3 (compiled with Erlang/OTP 24)
102102
```
103103

104-
This informs us we are using `Elixir version 1.10.4`
104+
This informs us we are using `Elixir version 1.12.3`
105105
which is the _latest_ version at the time of writing.
106106

107107
<br />
@@ -118,7 +118,7 @@ mix phx.new -v
118118
You should see:
119119

120120
```sh
121-
Phoenix v1.5.5
121+
Phoenix v1.6.2
122122
```
123123

124124
If you have an earlier version,
@@ -131,26 +131,6 @@ We are here to help!
131131

132132
<br />
133133

134-
**c.** **`Node.js` installed** on your computer.
135-
Download it from: https://nodejs.org
136-
137-
If you run the following command in your terminal:
138-
139-
```sh
140-
node -v
141-
```
142-
143-
You should see output similar to:
144-
145-
```
146-
v12.18.4
147-
```
148-
149-
> Phoenix LiveView does not require the _latest_ Node.js,
150-
> so if you have a _recent_ version e.g `v10`, you will be fine.
151-
152-
<br />
153-
154134
**d.** Familiarity with **basic `Elixir` syntax** is recommended
155135
but not essential; <br />
156136
you can pick it up as you go and
@@ -1262,47 +1242,6 @@ many are running.
12621242

12631243
<br /><br /><br />
12641244

1265-
## Notes and help
1266-
1267-
### Problems with dependencies
1268-
1269-
If the app hangs and throws this error:
1270-
1271-
```
1272-
[error] an exception was raised:
1273-
** (FunctionClauseError) no function clause matching in Phoenix.LiveView.Channel.start_link/1
1274-
(phoenix_live_view 0.12.1) lib/phoenix_live_view/channel.ex:12: Phoenix.LiveView.Channel.start_link({LivetestWeb.Endpoint, {#PID<0.643.0>, #Reference<0.4273921409.1426587651.156349>}})
1275-
1276-
```
1277-
1278-
Modifying your mix.deps from:
1279-
1280-
```elixir
1281-
defp deps do
1282-
[
1283-
{:phoenix, "~> 1.5.1"},
1284-
{:phoenix_live_view, "~> 0.12.1"},
1285-
...
1286-
]
1287-
end
1288-
```
1289-
1290-
to this:
1291-
1292-
```elixir
1293-
defp deps do
1294-
[
1295-
{:phoenix, "~> 1.5.3"},
1296-
{:phoenix_live_view, "~> 0.13.0"},
1297-
...
1298-
]
1299-
end
1300-
```
1301-
1302-
Should fix the problem.
1303-
1304-
---
1305-
13061245
## Credits & Thanks! 🙌
13071246

13081247
Credit for inspiring this tutorial goes to Dennis Beatty

assets/.babelrc

-5
This file was deleted.

assets/css/app.scss renamed to assets/css/app.css

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
/* This file is for your main application css. */
22
@import "./phoenix.css";
3-
@import "../node_modules/nprogress/nprogress.css";
3+
4+
#livecount_container {
5+
display: table;
6+
margin: auto;
7+
}
8+
9+
button {
10+
margin: 2px
11+
}
412

513
/* LiveView specific classes for your customizations */
614
.invalid-feedback {

assets/js/app.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// We need to import the CSS so that webpack will load it.
22
// The MiniCssExtractPlugin is used to separate it out into
33
// its own CSS file.
4-
import "../css/app.scss"
4+
import "../css/phoenix.css"
5+
import "../css/app.css"
56

67
// webpack automatically bundles all modules in your
78
// entry points. Those entry points can be configured
@@ -14,16 +15,11 @@ import "../css/app.scss"
1415
//
1516
import "phoenix_html"
1617
import {Socket} from "phoenix"
17-
import NProgress from "nprogress"
1818
import {LiveSocket} from "phoenix_live_view"
1919

2020
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
2121
let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}})
2222

23-
// Show progress bar on live navigation and form submits
24-
window.addEventListener("phx:page-loading-start", info => NProgress.start())
25-
window.addEventListener("phx:page-loading-stop", info => NProgress.done())
26-
2723
// connect if there are any LiveViews on the page
2824
liveSocket.connect()
2925

0 commit comments

Comments
 (0)