Skip to content

Commit a8b4d2c

Browse files
committed
Merge branch '0.18'
2 parents c8fdd50 + 1d6a46c commit a8b4d2c

File tree

10 files changed

+25
-36
lines changed

10 files changed

+25
-36
lines changed

elm-package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
],
99
"exposed-modules": [],
1010
"dependencies": {
11-
"elm-lang/core": "4.0.0 <= v < 5.0.0",
12-
"elm-lang/html": "1.0.0 <= v < 2.0.0",
13-
"elm-lang/svg": "1.0.0 <= v < 2.0.0",
14-
"elm-lang/websocket": "1.0.0 <= v < 2.0.0",
15-
"evancz/elm-http": "3.0.1 <= v < 4.0.0",
16-
"evancz/elm-markdown": "3.0.0 <= v < 4.0.0"
11+
"elm-lang/core": "5.0.0 <= v < 6.0.0",
12+
"elm-lang/html": "2.0.0 <= v < 3.0.0",
13+
"elm-lang/http": "1.0.0 <= v < 2.0.0",
14+
"elm-lang/svg": "2.0.0 <= v < 3.0.0",
15+
"elm-lang/websocket": "1.0.2 <= v < 2.0.0",
16+
"evancz/elm-markdown": "3.0.1 <= v < 4.0.0"
1717
},
18-
"elm-version": "0.17.0 <= v < 0.18.0"
19-
}
18+
"elm-version": "0.18.0 <= v < 0.19.0"
19+
}

examples/01-button.elm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import Html exposing (Html, button, div, text)
2-
import Html.App as App
32
import Html.Events exposing (onClick)
43

54

65

76
main =
8-
App.beginnerProgram
7+
Html.beginnerProgram
98
{ model = model
109
, view = view
1110
, update = update

examples/02-field.elm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Html exposing (Html, div, input, text)
2-
import Html.App as Html
32
import Html.Attributes exposing (..)
43
import Html.Events exposing (onInput)
54
import String

examples/03-form.elm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Html exposing (..)
2-
import Html.App as Html
32
import Html.Attributes exposing (..)
43
import Html.Events exposing (onInput)
54

@@ -58,9 +57,9 @@ update msg model =
5857
view : Model -> Html Msg
5958
view model =
6059
div []
61-
[ input [ type' "text", placeholder "Name", onInput Name ] []
62-
, input [ type' "password", placeholder "Password", onInput Password ] []
63-
, input [ type' "password", placeholder "Re-enter Password", onInput PasswordAgain ] []
60+
[ input [ type_ "text", placeholder "Name", onInput Name ] []
61+
, input [ type_ "password", placeholder "Password", onInput Password ] []
62+
, input [ type_ "password", placeholder "Re-enter Password", onInput PasswordAgain ] []
6463
, viewValidation model
6564
]
6665

examples/04-random.elm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Html exposing (..)
2-
import Html.App as Html
32
import Html.Events exposing (..)
43
import Random
54

examples/05-http.elm

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import Html exposing (..)
2-
import Html.App as Html
32
import Html.Attributes exposing (..)
43
import Html.Events exposing (..)
54
import Http
6-
import Json.Decode as Json
7-
import Task
5+
import Json.Decode as Decode
86

97

108

@@ -40,8 +38,7 @@ init topic =
4038

4139
type Msg
4240
= MorePlease
43-
| FetchSucceed String
44-
| FetchFail Http.Error
41+
| NewGif (Result Http.Error String)
4542

4643

4744
update : Msg -> Model -> (Model, Cmd Msg)
@@ -50,10 +47,10 @@ update msg model =
5047
MorePlease ->
5148
(model, getRandomGif model.topic)
5249

53-
FetchSucceed newUrl ->
50+
NewGif (Ok newUrl) ->
5451
(Model model.topic newUrl, Cmd.none)
5552

56-
FetchFail _ ->
53+
NewGif (Err _) ->
5754
(model, Cmd.none)
5855

5956

@@ -90,9 +87,9 @@ getRandomGif topic =
9087
url =
9188
"https://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=" ++ topic
9289
in
93-
Task.perform FetchFail FetchSucceed (Http.get decodeGifUrl url)
90+
Http.send NewGif (Http.get url decodeGifUrl)
9491

9592

96-
decodeGifUrl : Json.Decoder String
93+
decodeGifUrl : Decode.Decoder String
9794
decodeGifUrl =
98-
Json.at ["data", "image_url"] Json.string
95+
Decode.at ["data", "image_url"] Decode.string

examples/06-clock.elm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Html exposing (Html)
2-
import Html.App as Html
32
import Svg exposing (..)
43
import Svg.Attributes exposing (..)
54
import Time exposing (Time, second)

examples/07-websockets.elm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Html exposing (..)
2-
import Html.App as Html
32
import Html.Attributes exposing (..)
43
import Html.Events exposing (..)
54
import WebSocket

examples/08-checkboxes.elm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import Html exposing (Html, fieldset, input, label, text)
2-
import Html.App as App
3-
import Html.Attributes exposing (style, type')
2+
import Html.Attributes exposing (style, type_)
43
import Html.Events exposing (onClick)
54

65

76

87
main =
9-
App.beginnerProgram { model = optOut, update = update, view = view }
8+
Html.beginnerProgram { model = optOut, update = update, view = view }
109

1110

1211

@@ -66,6 +65,6 @@ checkbox msg name =
6665
label
6766
[ style [("padding", "20px")]
6867
]
69-
[ input [ type' "checkbox", onClick msg ] []
68+
[ input [ type_ "checkbox", onClick msg ] []
7069
, text name
7170
]

examples/09-radio.elm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import Html exposing (Html, Attribute, div, fieldset, input, label, text)
2-
import Html.App as App
3-
import Html.Attributes exposing (name, style, type')
2+
import Html.Attributes exposing (name, style, type_)
43
import Html.Events exposing (onClick)
54
import Markdown
65

76

87

98
main =
10-
App.beginnerProgram { model = chapter1, update = update, view = view }
9+
Html.beginnerProgram { model = chapter1, update = update, view = view }
1110

1211

1312

@@ -84,7 +83,7 @@ radio value msg =
8483
label
8584
[ style [("padding", "20px")]
8685
]
87-
[ input [ type' "radio", name "font-size", onClick msg ] []
86+
[ input [ type_ "radio", name "font-size", onClick msg ] []
8887
, text value
8988
]
9089

0 commit comments

Comments
 (0)