elm-pages 3.0.0-beta.0 → 3.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/codegen/elm-pages-codegen.js +38516 -0
  2. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateData.elmi +0 -0
  3. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateData.elmo +0 -0
  4. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateDataTest.elmi +0 -0
  5. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateDataTest.elmo +0 -0
  6. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Reporter.elmi +0 -0
  7. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Reporter.elmo +0 -0
  8. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Runner.elmi +0 -0
  9. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Runner.elmo +0 -0
  10. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/d.dat +0 -0
  11. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/i.dat +0 -0
  12. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/lock +0 -0
  13. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/o.dat +0 -0
  14. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm.json +1 -0
  15. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/Reporter.elm.js +6795 -0
  16. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/Runner.elm.js +25651 -0
  17. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/node_runner.js +110 -0
  18. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/node_supervisor.js +187 -0
  19. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/package.json +1 -0
  20. package/generator/dead-code-review/elm-stuff/tests-0.19.1/src/Reporter.elm +26 -0
  21. package/generator/dead-code-review/elm-stuff/tests-0.19.1/src/Runner.elm +62 -0
  22. package/generator/dead-code-review/elm.json +35 -0
  23. package/generator/dead-code-review/src/Pages/Review/DeadCodeEliminateData.elm +181 -0
  24. package/generator/dead-code-review/src/ReviewConfig.elm +9 -0
  25. package/generator/dead-code-review/tests/Pages/Review/DeadCodeEliminateDataTest.elm +455 -0
  26. package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/d.dat +0 -0
  27. package/generator/review/elm-stuff/tests-0.19.1/js/node_runner.js +1 -1
  28. package/generator/review/elm-stuff/tests-0.19.1/js/node_supervisor.js +1 -1
  29. package/generator/src/SharedTemplate.elm +1 -1
  30. package/generator/src/generate-template-module-connector.js +2 -22
  31. package/package.json +5 -2
  32. package/src/DataSource/File.elm +1 -1
  33. package/src/DataSource/Internal/Request.elm +0 -5
  34. package/src/Form.elm +1 -1
  35. package/src/Head/Seo.elm +16 -27
  36. package/src/Pages/Internal/NotFoundReason.elm +3 -2
  37. package/src/Pages/Internal/Platform/Cli.elm +13 -8
  38. package/src/Pages/Internal/Platform.elm +3 -3
  39. package/src/Pages/ProgramConfig.elm +1 -1
@@ -44,11 +44,11 @@ type NotFoundReason
44
44
  document :
45
45
  List RoutePattern
46
46
  -> Payload
47
- -> { title : String, body : Html msg }
47
+ -> { title : String, body : List (Html msg) }
48
48
  document pathPatterns payload =
49
49
  { title = "Page not found"
50
50
  , body =
51
- Html.div
51
+ [ Html.div
52
52
  [ Attr.id "not-found-reason"
53
53
  , Attr.style "padding" "30px"
54
54
  ]
@@ -110,6 +110,7 @@ document pathPatterns payload =
110
110
  , Html.text <| "TODO"
111
111
  ]
112
112
  )
113
+ ]
113
114
  }
114
115
 
115
116
 
@@ -829,13 +829,13 @@ sendSinglePageProgress site contentJson config model info =
829
829
  )
830
830
  |> Tuple.first
831
831
 
832
- viewValue : { title : String, body : Html (Pages.Msg.Msg userMsg) }
832
+ viewValue : { title : String, body : List (Html (Pages.Msg.Msg userMsg)) }
833
833
  viewValue =
834
834
  (config.view Dict.empty Dict.empty Nothing currentPage Nothing sharedData pageData maybeActionData |> .view) pageModel
835
835
  in
836
836
  PageServerResponse.RenderPage responseInfo
837
837
  { head = config.view Dict.empty Dict.empty Nothing currentPage Nothing sharedData pageData maybeActionData |> .head
838
- , view = viewValue.body |> HtmlPrinter.htmlToString
838
+ , view = viewValue.body |> bodyToString
839
839
  , title = viewValue.title
840
840
  }
841
841
 
@@ -871,7 +871,7 @@ sendSinglePageProgress site contentJson config model info =
871
871
  pageData =
872
872
  config.errorPageToData error
873
873
 
874
- viewValue : { title : String, body : Html (Pages.Msg.Msg userMsg) }
874
+ viewValue : { title : String, body : List (Html (Pages.Msg.Msg userMsg)) }
875
875
  viewValue =
876
876
  (config.view Dict.empty Dict.empty Nothing currentPage Nothing sharedData pageData Nothing |> .view) pageModel
877
877
  in
@@ -880,7 +880,7 @@ sendSinglePageProgress site contentJson config model info =
880
880
  , headers = record.headers
881
881
  }
882
882
  { head = config.view Dict.empty Dict.empty Nothing currentPage Nothing sharedData pageData Nothing |> .head
883
- , view = viewValue.body |> HtmlPrinter.htmlToString
883
+ , view = viewValue.body |> List.map HtmlPrinter.htmlToString |> String.join "\n"
884
884
  , title = viewValue.title
885
885
  }
886
886
  )
@@ -1143,7 +1143,7 @@ render404Page config sharedData model path notFoundReason =
1143
1143
  pathAndRoute =
1144
1144
  { path = path, route = config.notFoundRoute }
1145
1145
 
1146
- viewValue : { title : String, body : Html (Pages.Msg.Msg userMsg) }
1146
+ viewValue : { title : String, body : List (Html (Pages.Msg.Msg userMsg)) }
1147
1147
  viewValue =
1148
1148
  (config.view Dict.empty
1149
1149
  Dict.empty
@@ -1159,7 +1159,7 @@ render404Page config sharedData model path notFoundReason =
1159
1159
  in
1160
1160
  { route = Path.toAbsolute path
1161
1161
  , contentJson = Dict.empty
1162
- , html = viewValue.body |> HtmlPrinter.htmlToString
1162
+ , html = viewValue.body |> bodyToString
1163
1163
  , errors = []
1164
1164
  , head = config.view Dict.empty Dict.empty Nothing pathAndRoute Nothing justSharedData pageData Nothing |> .head
1165
1165
  , title = viewValue.title
@@ -1179,7 +1179,7 @@ render404Page config sharedData model path notFoundReason =
1179
1179
  |> config.encodeResponse
1180
1180
  |> Bytes.Encode.encode
1181
1181
 
1182
- notFoundDocument : { title : String, body : Html msg }
1182
+ notFoundDocument : { title : String, body : List (Html msg) }
1183
1183
  notFoundDocument =
1184
1184
  { path = path
1185
1185
  , reason = notFoundReason
@@ -1188,7 +1188,7 @@ render404Page config sharedData model path notFoundReason =
1188
1188
  in
1189
1189
  { route = Path.toAbsolute path
1190
1190
  , contentJson = Dict.empty
1191
- , html = HtmlPrinter.htmlToString notFoundDocument.body
1191
+ , html = bodyToString notFoundDocument.body
1192
1192
  , errors = []
1193
1193
  , head = []
1194
1194
  , title = notFoundDocument.title
@@ -1204,6 +1204,11 @@ render404Page config sharedData model path notFoundReason =
1204
1204
  |> Effect.SendSinglePageNew byteEncodedPageData
1205
1205
 
1206
1206
 
1207
+ bodyToString : List (Html msg) -> String
1208
+ bodyToString body =
1209
+ body |> List.map HtmlPrinter.htmlToString |> String.join "\n"
1210
+
1211
+
1207
1212
  urlToRoute : ProgramConfig userMsg userModel route pageData actionData sharedData effect mappedMsg errorPage -> Url -> route
1208
1213
  urlToRoute config url =
1209
1214
  if url.path |> String.startsWith "/____elm-pages-internal____" then
@@ -58,7 +58,7 @@ type alias Program userModel userMsg pageData actionData sharedData errorPage =
58
58
  mainView :
59
59
  ProgramConfig userMsg userModel route pageData actionData sharedData effect (Msg userMsg pageData actionData sharedData errorPage) errorPage
60
60
  -> Model userModel pageData actionData sharedData
61
- -> { title : String, body : Html (Pages.Msg.Msg userMsg) }
61
+ -> { title : String, body : List (Html (Pages.Msg.Msg userMsg)) }
62
62
  mainView config model =
63
63
  case model.notFound of
64
64
  Just info ->
@@ -95,7 +95,7 @@ mainView config model =
95
95
  Err error ->
96
96
  { title = "Page Data Error"
97
97
  , body =
98
- Html.div [] [ Html.text error ]
98
+ [ Html.div [] [ Html.text error ] ]
99
99
  }
100
100
 
101
101
 
@@ -124,9 +124,9 @@ view config model =
124
124
  { title = title
125
125
  , body =
126
126
  [ onViewChangeElement model.url
127
- , body |> Html.map UserMsg
128
127
  , AriaLiveAnnouncer.view model.ariaNavigationAnnouncement
129
128
  ]
129
+ ++ List.map (Html.map UserMsg) body
130
130
  }
131
131
 
132
132
 
@@ -65,7 +65,7 @@ type alias ProgramConfig userMsg userModel route pageData actionData sharedData
65
65
  -> pageData
66
66
  -> Maybe actionData
67
67
  ->
68
- { view : userModel -> { title : String, body : Html (Pages.Msg.Msg userMsg) }
68
+ { view : userModel -> { title : String, body : List (Html (Pages.Msg.Msg userMsg)) }
69
69
  , head : List Head.Tag
70
70
  }
71
71
  , handleRoute : route -> DataSource (Maybe NotFoundReason)