elm-pages 2.1.11 → 3.0.0-beta.1
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.
- package/codegen/elm-pages-codegen.js +38507 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateData.elmi +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateData.elmo +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateDataTest.elmi +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateDataTest.elmo +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Reporter.elmi +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Reporter.elmo +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Runner.elmi +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Runner.elmo +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/d.dat +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/i.dat +0 -0
- package/generator/{template/public/style.css → dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/lock} +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/o.dat +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm.json +1 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/Reporter.elm.js +6795 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/Runner.elm.js +25651 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/node_runner.js +110 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/node_supervisor.js +187 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/package.json +1 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/src/Reporter.elm +26 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/src/Runner.elm +62 -0
- package/generator/dead-code-review/elm.json +35 -0
- package/generator/dead-code-review/src/Pages/Review/DeadCodeEliminateData.elm +181 -0
- package/generator/dead-code-review/src/ReviewConfig.elm +9 -0
- package/generator/dead-code-review/tests/Pages/Review/DeadCodeEliminateDataTest.elm +455 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Internal-RoutePattern.elmi +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Internal-RoutePattern.elmo +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-NoContractViolations.elmi +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-NoContractViolations.elmo +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-NoContractViolationsTest.elmi +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-NoContractViolationsTest.elmo +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Reporter.elmi +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Reporter.elmo +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Runner.elmi +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Runner.elmo +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/d.dat +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/i.dat +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/lock +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/o.dat +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/elm.json +1 -0
- package/generator/review/elm-stuff/tests-0.19.1/js/Reporter.elm.js +6795 -0
- package/generator/review/elm-stuff/tests-0.19.1/js/Runner.elm.js +27617 -0
- package/generator/review/elm-stuff/tests-0.19.1/js/node_runner.js +110 -0
- package/generator/review/elm-stuff/tests-0.19.1/js/node_supervisor.js +187 -0
- package/generator/review/elm-stuff/tests-0.19.1/js/package.json +1 -0
- package/generator/review/elm-stuff/tests-0.19.1/src/Reporter.elm +26 -0
- package/generator/review/elm-stuff/tests-0.19.1/src/Runner.elm +62 -0
- package/generator/review/elm.json +13 -4
- package/{src → generator/review/src}/Pages/Review/NoContractViolations.elm +148 -148
- package/generator/review/tests/Pages/Review/NoContractViolationsTest.elm +331 -0
- package/generator/src/RouteBuilder.elm +420 -0
- package/generator/src/SharedTemplate.elm +4 -5
- package/generator/src/SiteConfig.elm +3 -9
- package/generator/src/build.js +308 -95
- package/generator/src/cli.js +103 -8
- package/generator/src/codegen.js +192 -35
- package/generator/src/compile-elm.js +183 -31
- package/generator/src/dev-server.js +353 -96
- package/generator/src/elm-application.json +3 -1
- package/generator/src/elm-codegen.js +34 -0
- package/generator/src/elm-file-constants.js +2 -0
- package/generator/src/error-formatter.js +20 -1
- package/generator/src/generate-template-module-connector.js +125 -927
- package/generator/src/hello.ts +5 -0
- package/generator/src/pre-render-html.js +58 -104
- package/generator/src/render-worker.js +27 -13
- package/generator/src/render.js +252 -197
- package/generator/src/request-cache-fs.js +18 -0
- package/generator/src/request-cache.js +128 -56
- package/generator/src/rewrite-client-elm-json.js +49 -0
- package/generator/src/route-codegen-helpers.js +62 -1
- package/generator/static-code/dev-style.css +22 -0
- package/generator/static-code/elm-pages.js +43 -39
- package/generator/static-code/hmr.js +98 -88
- package/generator/template/app/Api.elm +25 -0
- package/generator/template/app/ErrorPage.elm +38 -0
- package/generator/template/app/Route/Index.elm +87 -0
- package/generator/template/{src → app}/Shared.elm +34 -13
- package/generator/template/app/Site.elm +19 -0
- package/generator/template/{src → app}/View.elm +0 -0
- package/generator/template/elm-pages.config.mjs +5 -0
- package/generator/template/elm.json +1 -0
- package/generator/template/{public/index.js → index.ts} +7 -3
- package/generator/template/package.json +4 -4
- package/generator/template/public/favicon.ico +0 -0
- package/generator/template/public/images/icon-png.png +0 -0
- package/generator/template/src/.gitkeep +0 -0
- package/generator/template/style.css +4 -0
- package/package.json +33 -23
- package/src/ApiRoute.elm +176 -43
- package/src/BuildError.elm +10 -1
- package/src/CookieParser.elm +84 -0
- package/src/DataSource/Env.elm +38 -0
- package/src/DataSource/File.elm +27 -16
- package/src/DataSource/Glob.elm +126 -80
- package/src/DataSource/Http.elm +283 -304
- package/src/DataSource/Internal/Glob.elm +5 -21
- package/src/DataSource/Internal/Request.elm +25 -0
- package/src/DataSource/Port.elm +17 -14
- package/src/DataSource.elm +55 -318
- package/src/Form/Field.elm +717 -0
- package/src/Form/FieldStatus.elm +36 -0
- package/src/Form/FieldView.elm +417 -0
- package/src/Form/FormData.elm +22 -0
- package/src/Form/Validation.elm +391 -0
- package/src/Form/Value.elm +118 -0
- package/src/Form.elm +1683 -0
- package/src/FormData.elm +58 -0
- package/src/FormDecoder.elm +102 -0
- package/src/Head/Seo.elm +12 -4
- package/src/Head.elm +12 -2
- package/src/HtmlPrinter.elm +1 -1
- package/src/Internal/ApiRoute.elm +17 -4
- package/src/Internal/Request.elm +7 -0
- package/src/PageServerResponse.elm +68 -0
- package/src/Pages/ContentCache.elm +1 -229
- package/src/Pages/Fetcher.elm +58 -0
- package/src/Pages/FormState.elm +256 -0
- package/src/Pages/Generate.elm +800 -0
- package/src/Pages/Internal/Form.elm +17 -0
- package/src/Pages/Internal/NotFoundReason.elm +3 -55
- package/src/Pages/Internal/Platform/Cli.elm +777 -579
- package/src/Pages/Internal/Platform/Effect.elm +5 -5
- package/src/Pages/Internal/Platform/StaticResponses.elm +178 -394
- package/src/Pages/Internal/Platform/ToJsPayload.elm +24 -23
- package/src/Pages/Internal/Platform.elm +1244 -504
- package/src/Pages/Internal/ResponseSketch.elm +19 -0
- package/src/Pages/Internal/RoutePattern.elm +596 -45
- package/src/Pages/Manifest.elm +26 -0
- package/src/Pages/Msg.elm +79 -0
- package/src/Pages/ProgramConfig.elm +67 -14
- package/src/Pages/SiteConfig.elm +3 -6
- package/src/Pages/StaticHttp/Request.elm +4 -2
- package/src/Pages/StaticHttpRequest.elm +50 -215
- package/src/Pages/Transition.elm +70 -0
- package/src/Path.elm +1 -0
- package/src/Pattern.elm +98 -0
- package/src/RenderRequest.elm +2 -2
- package/src/RequestsAndPending.elm +111 -9
- package/src/Server/Request.elm +1253 -0
- package/src/Server/Response.elm +292 -0
- package/src/Server/Session.elm +316 -0
- package/src/Server/SetCookie.elm +169 -0
- package/src/TerminalText.elm +1 -1
- package/src/Test/Html/Internal/ElmHtml/Markdown.elm +0 -1
- package/src/Test/Html/Internal/ElmHtml/ToString.elm +1 -1
- package/generator/src/Page.elm +0 -359
- package/generator/src/codegen-template-module.js +0 -183
- package/generator/src/elm-pages-js-minified.js +0 -1
- package/generator/template/src/Api.elm +0 -14
- package/generator/template/src/Page/Index.elm +0 -69
- package/generator/template/src/Site.elm +0 -41
- package/src/DataSource/ServerRequest.elm +0 -60
- package/src/Internal/OptimizedDecoder.elm +0 -18
- package/src/KeepOrDiscard.elm +0 -6
- package/src/OptimizedDecoder/Pipeline.elm +0 -335
- package/src/OptimizedDecoder.elm +0 -818
- package/src/Pages/Internal/ApplicationType.elm +0 -6
- package/src/Pages/Secrets.elm +0 -83
- package/src/Secrets.elm +0 -111
- package/src/SecretsDict.elm +0 -45
|
@@ -0,0 +1,800 @@
|
|
|
1
|
+
module Pages.Generate exposing (Type(..), serverRender, buildWithLocalState, buildNoState, Builder)
|
|
2
|
+
|
|
3
|
+
{-|
|
|
4
|
+
|
|
5
|
+
@docs Type, serverRender, buildWithLocalState, buildNoState, Builder
|
|
6
|
+
|
|
7
|
+
-}
|
|
8
|
+
|
|
9
|
+
import Elm
|
|
10
|
+
import Elm.Annotation
|
|
11
|
+
import Elm.Declare
|
|
12
|
+
import Pages.Internal.RoutePattern as RoutePattern
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
{-| -}
|
|
16
|
+
type Type
|
|
17
|
+
= Alias Elm.Annotation.Annotation
|
|
18
|
+
| Custom (List Elm.Variant)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
typeToDeclaration : String -> Type -> Elm.Declaration
|
|
22
|
+
typeToDeclaration name type_ =
|
|
23
|
+
case type_ of
|
|
24
|
+
Alias annotation ->
|
|
25
|
+
Elm.alias name annotation
|
|
26
|
+
|
|
27
|
+
Custom variants ->
|
|
28
|
+
Elm.customType name variants
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
{-| -}
|
|
32
|
+
type Builder
|
|
33
|
+
= Builder
|
|
34
|
+
{ data : ( Type, Elm.Expression -> Elm.Expression )
|
|
35
|
+
, action : ( Type, Elm.Expression -> Elm.Expression )
|
|
36
|
+
, head : Elm.Expression -> Elm.Expression
|
|
37
|
+
, moduleName : List String
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
{-| -}
|
|
42
|
+
serverRender :
|
|
43
|
+
{ data : ( Type, Elm.Expression -> Elm.Expression )
|
|
44
|
+
, action : ( Type, Elm.Expression -> Elm.Expression )
|
|
45
|
+
, head : Elm.Expression -> Elm.Expression
|
|
46
|
+
, moduleName : List String
|
|
47
|
+
}
|
|
48
|
+
-> Builder
|
|
49
|
+
serverRender =
|
|
50
|
+
Builder
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
{-| -}
|
|
54
|
+
buildNoState :
|
|
55
|
+
{ view : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
56
|
+
}
|
|
57
|
+
-> Builder
|
|
58
|
+
-> Elm.File
|
|
59
|
+
buildNoState definitions (Builder builder) =
|
|
60
|
+
userFunction builder.moduleName
|
|
61
|
+
{ view = \_ -> definitions.view
|
|
62
|
+
, localState = Nothing
|
|
63
|
+
, data = builder.data |> Tuple.second
|
|
64
|
+
, action = builder.action |> Tuple.second
|
|
65
|
+
, head = builder.head
|
|
66
|
+
, types =
|
|
67
|
+
{ model = Alias (Elm.Annotation.record [])
|
|
68
|
+
, msg = Alias Elm.Annotation.unit
|
|
69
|
+
, data = builder.data |> Tuple.first
|
|
70
|
+
, actionData = builder.action |> Tuple.first
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
{-| -}
|
|
76
|
+
buildWithLocalState :
|
|
77
|
+
{ view : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
78
|
+
, update : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
79
|
+
, init : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
80
|
+
, subscriptions : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
81
|
+
, msg : Type
|
|
82
|
+
, model : Type
|
|
83
|
+
}
|
|
84
|
+
-> Builder
|
|
85
|
+
-> Elm.File
|
|
86
|
+
buildWithLocalState definitions (Builder builder) =
|
|
87
|
+
userFunction builder.moduleName
|
|
88
|
+
{ view = definitions.view
|
|
89
|
+
, localState =
|
|
90
|
+
Just
|
|
91
|
+
{ update = definitions.update
|
|
92
|
+
, init = definitions.init
|
|
93
|
+
, subscriptions = definitions.subscriptions
|
|
94
|
+
}
|
|
95
|
+
, data = builder.data |> Tuple.second
|
|
96
|
+
, action = builder.action |> Tuple.second
|
|
97
|
+
, head = builder.head
|
|
98
|
+
, types =
|
|
99
|
+
{ model = definitions.model
|
|
100
|
+
, msg = definitions.msg
|
|
101
|
+
, data = builder.data |> Tuple.first
|
|
102
|
+
, actionData = builder.action |> Tuple.first
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
{-| -}
|
|
108
|
+
userFunction :
|
|
109
|
+
List String
|
|
110
|
+
->
|
|
111
|
+
{ view : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
112
|
+
, localState :
|
|
113
|
+
Maybe
|
|
114
|
+
{ update : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
115
|
+
, init : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
116
|
+
, subscriptions : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
117
|
+
}
|
|
118
|
+
, data : Elm.Expression -> Elm.Expression
|
|
119
|
+
, action : Elm.Expression -> Elm.Expression
|
|
120
|
+
, head : Elm.Expression -> Elm.Expression
|
|
121
|
+
, types : { model : Type, msg : Type, data : Type, actionData : Type }
|
|
122
|
+
}
|
|
123
|
+
-> Elm.File
|
|
124
|
+
userFunction moduleName definitions =
|
|
125
|
+
let
|
|
126
|
+
viewFn :
|
|
127
|
+
{ declaration : Elm.Declaration
|
|
128
|
+
, call : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
129
|
+
, callFrom : List String -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
130
|
+
}
|
|
131
|
+
viewFn =
|
|
132
|
+
case definitions.localState of
|
|
133
|
+
Just _ ->
|
|
134
|
+
Elm.Declare.fn4 "view"
|
|
135
|
+
( "maybeUrl"
|
|
136
|
+
, "PageUrl"
|
|
137
|
+
|> Elm.Annotation.named [ "Pages", "PageUrl" ]
|
|
138
|
+
|> Elm.Annotation.maybe
|
|
139
|
+
|> Just
|
|
140
|
+
)
|
|
141
|
+
( "sharedModel"
|
|
142
|
+
, Nothing
|
|
143
|
+
)
|
|
144
|
+
( "model", Just (Elm.Annotation.named [] "Model") )
|
|
145
|
+
( "app", Just appType )
|
|
146
|
+
definitions.view
|
|
147
|
+
|
|
148
|
+
Nothing ->
|
|
149
|
+
let
|
|
150
|
+
viewDeclaration :
|
|
151
|
+
{ declaration : Elm.Declaration
|
|
152
|
+
, call : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
153
|
+
, callFrom : List String -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
154
|
+
}
|
|
155
|
+
viewDeclaration =
|
|
156
|
+
Elm.Declare.fn3 "view"
|
|
157
|
+
( "maybeUrl"
|
|
158
|
+
, "PageUrl"
|
|
159
|
+
|> Elm.Annotation.named [ "Pages", "PageUrl" ]
|
|
160
|
+
|> Elm.Annotation.maybe
|
|
161
|
+
|> Just
|
|
162
|
+
)
|
|
163
|
+
( "sharedModel"
|
|
164
|
+
, Nothing
|
|
165
|
+
)
|
|
166
|
+
( "app", Just appType )
|
|
167
|
+
(definitions.view Elm.unit)
|
|
168
|
+
in
|
|
169
|
+
{ declaration = viewDeclaration.declaration
|
|
170
|
+
, call = \_ -> viewDeclaration.call
|
|
171
|
+
, callFrom = \a _ c d -> viewDeclaration.callFrom a c d
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
localDefinitions :
|
|
175
|
+
Maybe
|
|
176
|
+
{ updateFn :
|
|
177
|
+
{ declaration : Elm.Declaration
|
|
178
|
+
, call : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
179
|
+
, callFrom : List String -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
180
|
+
}
|
|
181
|
+
, initFn : { declaration : Elm.Declaration, call : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression, callFrom : List String -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression }
|
|
182
|
+
, subscriptionsFn : { declaration : Elm.Declaration, call : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression, callFrom : List String -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression }
|
|
183
|
+
}
|
|
184
|
+
localDefinitions =
|
|
185
|
+
definitions.localState
|
|
186
|
+
|> Maybe.map
|
|
187
|
+
(\localState ->
|
|
188
|
+
{ updateFn =
|
|
189
|
+
Elm.Declare.fn5 "update"
|
|
190
|
+
( "pageUrl"
|
|
191
|
+
, "PageUrl"
|
|
192
|
+
|> Elm.Annotation.named [ "Pages", "PageUrl" ]
|
|
193
|
+
|> Just
|
|
194
|
+
)
|
|
195
|
+
( "sharedModel", Nothing )
|
|
196
|
+
( "app", Just appType )
|
|
197
|
+
( "msg", Just (Elm.Annotation.named [] "Msg") )
|
|
198
|
+
( "model", Just (Elm.Annotation.named [] "Model") )
|
|
199
|
+
localState.update
|
|
200
|
+
, initFn =
|
|
201
|
+
Elm.Declare.fn3 "init"
|
|
202
|
+
( "pageUrl"
|
|
203
|
+
, "PageUrl"
|
|
204
|
+
|> Elm.Annotation.named [ "Pages", "PageUrl" ]
|
|
205
|
+
|> Elm.Annotation.maybe
|
|
206
|
+
|> Just
|
|
207
|
+
)
|
|
208
|
+
( "sharedModel", Nothing )
|
|
209
|
+
( "app", Just appType )
|
|
210
|
+
localState.init
|
|
211
|
+
, subscriptionsFn =
|
|
212
|
+
Elm.Declare.fn5
|
|
213
|
+
"subscriptions"
|
|
214
|
+
( "maybePageUrl"
|
|
215
|
+
, "PageUrl"
|
|
216
|
+
|> Elm.Annotation.named [ "Pages", "PageUrl" ]
|
|
217
|
+
|> Elm.Annotation.maybe
|
|
218
|
+
|> Just
|
|
219
|
+
)
|
|
220
|
+
( "routeParams", Nothing )
|
|
221
|
+
( "path", Nothing )
|
|
222
|
+
( "sharedModel", Nothing )
|
|
223
|
+
( "model", Nothing )
|
|
224
|
+
localState.subscriptions
|
|
225
|
+
}
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
dataFn : { declaration : Elm.Declaration, call : Elm.Expression -> Elm.Expression, callFrom : List String -> Elm.Expression -> Elm.Expression }
|
|
229
|
+
dataFn =
|
|
230
|
+
Elm.Declare.fn "data"
|
|
231
|
+
( "routeParams"
|
|
232
|
+
, "RouteParams"
|
|
233
|
+
|> Elm.Annotation.named []
|
|
234
|
+
|> Just
|
|
235
|
+
)
|
|
236
|
+
(definitions.data >> Elm.withType (myType "Data"))
|
|
237
|
+
|
|
238
|
+
actionFn : { declaration : Elm.Declaration, call : Elm.Expression -> Elm.Expression, callFrom : List String -> Elm.Expression -> Elm.Expression }
|
|
239
|
+
actionFn =
|
|
240
|
+
Elm.Declare.fn "action"
|
|
241
|
+
( "routeParams"
|
|
242
|
+
, "RouteParams"
|
|
243
|
+
|> Elm.Annotation.named []
|
|
244
|
+
|> Just
|
|
245
|
+
)
|
|
246
|
+
(definitions.action >> Elm.withType (myType "ActionData"))
|
|
247
|
+
|
|
248
|
+
headFn : { declaration : Elm.Declaration, call : Elm.Expression -> Elm.Expression, callFrom : List String -> Elm.Expression -> Elm.Expression }
|
|
249
|
+
headFn =
|
|
250
|
+
Elm.Declare.fn "head"
|
|
251
|
+
( "app", Just appType )
|
|
252
|
+
(definitions.head
|
|
253
|
+
>> Elm.withType
|
|
254
|
+
(Elm.Annotation.list
|
|
255
|
+
(Elm.Annotation.named [ "Head" ] "Tag")
|
|
256
|
+
)
|
|
257
|
+
)
|
|
258
|
+
in
|
|
259
|
+
Elm.file ("Route" :: moduleName)
|
|
260
|
+
([ definitions.types.model |> typeToDeclaration "Model"
|
|
261
|
+
, definitions.types.msg |> typeToDeclaration "Msg"
|
|
262
|
+
, Elm.alias "RouteParams"
|
|
263
|
+
(Elm.Annotation.record
|
|
264
|
+
(RoutePattern.fromModuleName moduleName
|
|
265
|
+
-- TODO give error if not parseable here
|
|
266
|
+
|> Maybe.map RoutePattern.toRouteParamsRecord
|
|
267
|
+
|> Maybe.withDefault []
|
|
268
|
+
)
|
|
269
|
+
)
|
|
270
|
+
, Elm.declaration "route"
|
|
271
|
+
(serverRender_
|
|
272
|
+
{ action =
|
|
273
|
+
\routeParams ->
|
|
274
|
+
actionFn.call routeParams
|
|
275
|
+
|> Elm.withType (myType "ActionData")
|
|
276
|
+
, data =
|
|
277
|
+
\routeParams ->
|
|
278
|
+
dataFn.call routeParams
|
|
279
|
+
|> Elm.withType (myType "Data")
|
|
280
|
+
, head = headFn.call
|
|
281
|
+
}
|
|
282
|
+
|> (case localDefinitions of
|
|
283
|
+
Just local ->
|
|
284
|
+
buildWithLocalState_
|
|
285
|
+
{ view = viewFn.call
|
|
286
|
+
, update = local.updateFn.call
|
|
287
|
+
, init = local.initFn.call
|
|
288
|
+
, subscriptions = local.subscriptionsFn.call
|
|
289
|
+
}
|
|
290
|
+
>> Elm.withType
|
|
291
|
+
(Elm.Annotation.namedWith [ "RouteBuilder" ]
|
|
292
|
+
"StatefulRoute"
|
|
293
|
+
[ localType "RouteParams"
|
|
294
|
+
, localType "Data"
|
|
295
|
+
, localType "ActionData"
|
|
296
|
+
, localType "Model"
|
|
297
|
+
, localType "Msg"
|
|
298
|
+
]
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
Nothing ->
|
|
302
|
+
buildNoState_
|
|
303
|
+
{ view = viewFn.call Elm.unit
|
|
304
|
+
}
|
|
305
|
+
>> Elm.withType
|
|
306
|
+
(Elm.Annotation.namedWith [ "RouteBuilder" ]
|
|
307
|
+
"StatelessRoute"
|
|
308
|
+
[ localType "RouteParams"
|
|
309
|
+
, localType "Data"
|
|
310
|
+
, localType "ActionData"
|
|
311
|
+
]
|
|
312
|
+
)
|
|
313
|
+
)
|
|
314
|
+
)
|
|
315
|
+
]
|
|
316
|
+
++ (case localDefinitions of
|
|
317
|
+
Just local ->
|
|
318
|
+
[ local.initFn.declaration
|
|
319
|
+
, local.updateFn.declaration
|
|
320
|
+
, local.subscriptionsFn.declaration
|
|
321
|
+
]
|
|
322
|
+
|
|
323
|
+
Nothing ->
|
|
324
|
+
[]
|
|
325
|
+
)
|
|
326
|
+
++ [ definitions.types.data |> typeToDeclaration "Data"
|
|
327
|
+
, definitions.types.actionData |> typeToDeclaration "ActionData"
|
|
328
|
+
, dataFn.declaration
|
|
329
|
+
, actionFn.declaration
|
|
330
|
+
, headFn.declaration
|
|
331
|
+
, viewFn.declaration
|
|
332
|
+
]
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
localType : String -> Elm.Annotation.Annotation
|
|
337
|
+
localType =
|
|
338
|
+
Elm.Annotation.named []
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
myType : String -> Elm.Annotation.Annotation
|
|
342
|
+
myType dataType =
|
|
343
|
+
Elm.Annotation.namedWith [ "Server", "Request" ]
|
|
344
|
+
"Parser"
|
|
345
|
+
[ Elm.Annotation.namedWith [ "DataSource" ]
|
|
346
|
+
"DataSource"
|
|
347
|
+
[ Elm.Annotation.namedWith [ "Server", "Response" ]
|
|
348
|
+
"Response"
|
|
349
|
+
[ Elm.Annotation.named [] dataType
|
|
350
|
+
, Elm.Annotation.named [ "ErrorPage" ] "ErrorPage"
|
|
351
|
+
]
|
|
352
|
+
]
|
|
353
|
+
]
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
appType : Elm.Annotation.Annotation
|
|
357
|
+
appType =
|
|
358
|
+
Elm.Annotation.namedWith [ "RouteBuilder" ]
|
|
359
|
+
"StaticPayload"
|
|
360
|
+
[ Elm.Annotation.named [] "Data"
|
|
361
|
+
, Elm.Annotation.named [] "ActionData"
|
|
362
|
+
, Elm.Annotation.named [] "RouteParams"
|
|
363
|
+
]
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
serverRender_ :
|
|
367
|
+
{ data : Elm.Expression -> Elm.Expression
|
|
368
|
+
, action : Elm.Expression -> Elm.Expression
|
|
369
|
+
, head : Elm.Expression -> Elm.Expression
|
|
370
|
+
}
|
|
371
|
+
-> Elm.Expression
|
|
372
|
+
serverRender_ serverRenderArg =
|
|
373
|
+
Elm.apply
|
|
374
|
+
(Elm.value
|
|
375
|
+
{ importFrom = [ "RouteBuilder" ]
|
|
376
|
+
, name = "serverRender"
|
|
377
|
+
, annotation =
|
|
378
|
+
Just
|
|
379
|
+
(Elm.Annotation.function
|
|
380
|
+
[ Elm.Annotation.record
|
|
381
|
+
[ ( "data"
|
|
382
|
+
, Elm.Annotation.function
|
|
383
|
+
[ Elm.Annotation.var "routeParams" ]
|
|
384
|
+
(Elm.Annotation.namedWith
|
|
385
|
+
[ "Server", "Request" ]
|
|
386
|
+
"Parser"
|
|
387
|
+
[ Elm.Annotation.namedWith
|
|
388
|
+
[ "DataSource" ]
|
|
389
|
+
"DataSource"
|
|
390
|
+
[ Elm.Annotation.namedWith
|
|
391
|
+
[ "Server", "Response" ]
|
|
392
|
+
"Response"
|
|
393
|
+
[ Elm.Annotation.var "data"
|
|
394
|
+
, Elm.Annotation.namedWith
|
|
395
|
+
[ "ErrorPage" ]
|
|
396
|
+
"ErrorPage"
|
|
397
|
+
[]
|
|
398
|
+
]
|
|
399
|
+
]
|
|
400
|
+
]
|
|
401
|
+
)
|
|
402
|
+
)
|
|
403
|
+
, ( "action"
|
|
404
|
+
, Elm.Annotation.function
|
|
405
|
+
[ Elm.Annotation.var "routeParams" ]
|
|
406
|
+
(Elm.Annotation.namedWith
|
|
407
|
+
[ "Server", "Request" ]
|
|
408
|
+
"Parser"
|
|
409
|
+
[ Elm.Annotation.namedWith
|
|
410
|
+
[ "DataSource" ]
|
|
411
|
+
"DataSource"
|
|
412
|
+
[ Elm.Annotation.namedWith
|
|
413
|
+
[ "Server", "Response" ]
|
|
414
|
+
"Response"
|
|
415
|
+
[ Elm.Annotation.var "action"
|
|
416
|
+
, Elm.Annotation.namedWith
|
|
417
|
+
[ "ErrorPage" ]
|
|
418
|
+
"ErrorPage"
|
|
419
|
+
[]
|
|
420
|
+
]
|
|
421
|
+
]
|
|
422
|
+
]
|
|
423
|
+
)
|
|
424
|
+
)
|
|
425
|
+
, ( "head"
|
|
426
|
+
, Elm.Annotation.function
|
|
427
|
+
[ Elm.Annotation.namedWith
|
|
428
|
+
[ "RouteBuilder" ]
|
|
429
|
+
"StaticPayload"
|
|
430
|
+
[ Elm.Annotation.var "data"
|
|
431
|
+
, Elm.Annotation.var "action"
|
|
432
|
+
, Elm.Annotation.var "routeParams"
|
|
433
|
+
]
|
|
434
|
+
]
|
|
435
|
+
(Elm.Annotation.list
|
|
436
|
+
(Elm.Annotation.namedWith [ "Head" ] "Tag" [])
|
|
437
|
+
)
|
|
438
|
+
)
|
|
439
|
+
]
|
|
440
|
+
]
|
|
441
|
+
(Elm.Annotation.namedWith
|
|
442
|
+
[ "RouteBuilder" ]
|
|
443
|
+
"Builder"
|
|
444
|
+
[ Elm.Annotation.var "routeParams"
|
|
445
|
+
, Elm.Annotation.var "data"
|
|
446
|
+
, Elm.Annotation.var "action"
|
|
447
|
+
]
|
|
448
|
+
)
|
|
449
|
+
)
|
|
450
|
+
}
|
|
451
|
+
)
|
|
452
|
+
[ Elm.record
|
|
453
|
+
[ Tuple.pair
|
|
454
|
+
"data"
|
|
455
|
+
(Elm.functionReduced "serverRenderUnpack" serverRenderArg.data)
|
|
456
|
+
, Tuple.pair
|
|
457
|
+
"action"
|
|
458
|
+
(Elm.functionReduced "serverRenderUnpack" serverRenderArg.action)
|
|
459
|
+
, Tuple.pair
|
|
460
|
+
"head"
|
|
461
|
+
(Elm.functionReduced "serverRenderUnpack" serverRenderArg.head)
|
|
462
|
+
]
|
|
463
|
+
]
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
buildWithLocalState_ :
|
|
467
|
+
{ view :
|
|
468
|
+
Elm.Expression
|
|
469
|
+
-> Elm.Expression
|
|
470
|
+
-> Elm.Expression
|
|
471
|
+
-> Elm.Expression
|
|
472
|
+
-> Elm.Expression
|
|
473
|
+
, init :
|
|
474
|
+
Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
475
|
+
, update :
|
|
476
|
+
Elm.Expression
|
|
477
|
+
-> Elm.Expression
|
|
478
|
+
-> Elm.Expression
|
|
479
|
+
-> Elm.Expression
|
|
480
|
+
-> Elm.Expression
|
|
481
|
+
-> Elm.Expression
|
|
482
|
+
, subscriptions :
|
|
483
|
+
Elm.Expression
|
|
484
|
+
-> Elm.Expression
|
|
485
|
+
-> Elm.Expression
|
|
486
|
+
-> Elm.Expression
|
|
487
|
+
-> Elm.Expression
|
|
488
|
+
-> Elm.Expression
|
|
489
|
+
}
|
|
490
|
+
-> Elm.Expression
|
|
491
|
+
-> Elm.Expression
|
|
492
|
+
buildWithLocalState_ buildWithLocalStateArg buildWithLocalStateArg0 =
|
|
493
|
+
Elm.apply
|
|
494
|
+
(Elm.value
|
|
495
|
+
{ importFrom = [ "RouteBuilder" ]
|
|
496
|
+
, name = "buildWithLocalState"
|
|
497
|
+
, annotation =
|
|
498
|
+
Just
|
|
499
|
+
(Elm.Annotation.function
|
|
500
|
+
[ Elm.Annotation.record
|
|
501
|
+
[ ( "view"
|
|
502
|
+
, Elm.Annotation.function
|
|
503
|
+
[ Elm.Annotation.maybe
|
|
504
|
+
(Elm.Annotation.namedWith
|
|
505
|
+
[ "Pages", "PageUrl" ]
|
|
506
|
+
"PageUrl"
|
|
507
|
+
[]
|
|
508
|
+
)
|
|
509
|
+
, Elm.Annotation.namedWith [ "Shared" ] "Model" []
|
|
510
|
+
, Elm.Annotation.var "model"
|
|
511
|
+
, Elm.Annotation.namedWith
|
|
512
|
+
[ "RouteBuilder" ]
|
|
513
|
+
"StaticPayload"
|
|
514
|
+
[ Elm.Annotation.var "data"
|
|
515
|
+
, Elm.Annotation.var "action"
|
|
516
|
+
, Elm.Annotation.var "routeParams"
|
|
517
|
+
]
|
|
518
|
+
]
|
|
519
|
+
(Elm.Annotation.namedWith
|
|
520
|
+
[ "View" ]
|
|
521
|
+
"View"
|
|
522
|
+
[ Elm.Annotation.namedWith
|
|
523
|
+
[ "Pages", "Msg" ]
|
|
524
|
+
"Msg"
|
|
525
|
+
[ Elm.Annotation.var "msg" ]
|
|
526
|
+
]
|
|
527
|
+
)
|
|
528
|
+
)
|
|
529
|
+
, ( "init"
|
|
530
|
+
, Elm.Annotation.function
|
|
531
|
+
[ Elm.Annotation.maybe
|
|
532
|
+
(Elm.Annotation.namedWith
|
|
533
|
+
[ "Pages", "PageUrl" ]
|
|
534
|
+
"PageUrl"
|
|
535
|
+
[]
|
|
536
|
+
)
|
|
537
|
+
, Elm.Annotation.namedWith [ "Shared" ] "Model" []
|
|
538
|
+
, Elm.Annotation.namedWith
|
|
539
|
+
[ "RouteBuilder" ]
|
|
540
|
+
"StaticPayload"
|
|
541
|
+
[ Elm.Annotation.var "data"
|
|
542
|
+
, Elm.Annotation.var "action"
|
|
543
|
+
, Elm.Annotation.var "routeParams"
|
|
544
|
+
]
|
|
545
|
+
]
|
|
546
|
+
(Elm.Annotation.tuple
|
|
547
|
+
(Elm.Annotation.var "model")
|
|
548
|
+
(Elm.Annotation.namedWith
|
|
549
|
+
[ "Effect" ]
|
|
550
|
+
"Effect"
|
|
551
|
+
[ Elm.Annotation.var "msg" ]
|
|
552
|
+
)
|
|
553
|
+
)
|
|
554
|
+
)
|
|
555
|
+
, ( "update"
|
|
556
|
+
, Elm.Annotation.function
|
|
557
|
+
[ Elm.Annotation.namedWith
|
|
558
|
+
[ "Pages", "PageUrl" ]
|
|
559
|
+
"PageUrl"
|
|
560
|
+
[]
|
|
561
|
+
, Elm.Annotation.namedWith [ "Shared" ] "Model" []
|
|
562
|
+
, Elm.Annotation.namedWith
|
|
563
|
+
[ "RouteBuilder" ]
|
|
564
|
+
"StaticPayload"
|
|
565
|
+
[ Elm.Annotation.var "data"
|
|
566
|
+
, Elm.Annotation.var "action"
|
|
567
|
+
, Elm.Annotation.var "routeParams"
|
|
568
|
+
]
|
|
569
|
+
, Elm.Annotation.var "msg"
|
|
570
|
+
, Elm.Annotation.var "model"
|
|
571
|
+
]
|
|
572
|
+
(Elm.Annotation.tuple
|
|
573
|
+
(Elm.Annotation.var "model")
|
|
574
|
+
(Elm.Annotation.namedWith
|
|
575
|
+
[ "Effect" ]
|
|
576
|
+
"Effect"
|
|
577
|
+
[ Elm.Annotation.var "msg" ]
|
|
578
|
+
)
|
|
579
|
+
)
|
|
580
|
+
)
|
|
581
|
+
, ( "subscriptions"
|
|
582
|
+
, Elm.Annotation.function
|
|
583
|
+
[ Elm.Annotation.maybe
|
|
584
|
+
(Elm.Annotation.namedWith
|
|
585
|
+
[ "Pages", "PageUrl" ]
|
|
586
|
+
"PageUrl"
|
|
587
|
+
[]
|
|
588
|
+
)
|
|
589
|
+
, Elm.Annotation.var "routeParams"
|
|
590
|
+
, Elm.Annotation.namedWith [ "Path" ] "Path" []
|
|
591
|
+
, Elm.Annotation.namedWith [ "Shared" ] "Model" []
|
|
592
|
+
, Elm.Annotation.var "model"
|
|
593
|
+
]
|
|
594
|
+
(Elm.Annotation.namedWith [] "Sub" [ Elm.Annotation.var "msg" ])
|
|
595
|
+
)
|
|
596
|
+
]
|
|
597
|
+
, Elm.Annotation.namedWith
|
|
598
|
+
[ "RouteBuilder" ]
|
|
599
|
+
"Builder"
|
|
600
|
+
[ Elm.Annotation.var "routeParams"
|
|
601
|
+
, Elm.Annotation.var "data"
|
|
602
|
+
, Elm.Annotation.var "action"
|
|
603
|
+
]
|
|
604
|
+
]
|
|
605
|
+
(Elm.Annotation.namedWith
|
|
606
|
+
[ "RouteBuilder" ]
|
|
607
|
+
"StatefulRoute"
|
|
608
|
+
[ Elm.Annotation.var "routeParams"
|
|
609
|
+
, Elm.Annotation.var "data"
|
|
610
|
+
, Elm.Annotation.var "action"
|
|
611
|
+
, Elm.Annotation.var "model"
|
|
612
|
+
, Elm.Annotation.var "msg"
|
|
613
|
+
]
|
|
614
|
+
)
|
|
615
|
+
)
|
|
616
|
+
}
|
|
617
|
+
)
|
|
618
|
+
[ Elm.record
|
|
619
|
+
[ Tuple.pair
|
|
620
|
+
"view"
|
|
621
|
+
(Elm.functionReduced
|
|
622
|
+
"buildWithLocalStateUnpack"
|
|
623
|
+
(\functionReducedUnpack ->
|
|
624
|
+
Elm.functionReduced
|
|
625
|
+
"unpack"
|
|
626
|
+
(\functionReducedUnpack0 ->
|
|
627
|
+
Elm.functionReduced
|
|
628
|
+
"unpack"
|
|
629
|
+
(\functionReducedUnpack_2_1_2_0_2_2_0_1_0_2_0_0 ->
|
|
630
|
+
Elm.functionReduced
|
|
631
|
+
"unpack"
|
|
632
|
+
(buildWithLocalStateArg.view
|
|
633
|
+
functionReducedUnpack
|
|
634
|
+
functionReducedUnpack0
|
|
635
|
+
functionReducedUnpack_2_1_2_0_2_2_0_1_0_2_0_0
|
|
636
|
+
)
|
|
637
|
+
)
|
|
638
|
+
)
|
|
639
|
+
)
|
|
640
|
+
)
|
|
641
|
+
, Tuple.pair
|
|
642
|
+
"init"
|
|
643
|
+
(Elm.functionReduced
|
|
644
|
+
"buildWithLocalStateUnpack"
|
|
645
|
+
(\functionReducedUnpack ->
|
|
646
|
+
Elm.functionReduced
|
|
647
|
+
"unpack"
|
|
648
|
+
(\functionReducedUnpack0 ->
|
|
649
|
+
Elm.functionReduced
|
|
650
|
+
"unpack"
|
|
651
|
+
(buildWithLocalStateArg.init
|
|
652
|
+
functionReducedUnpack
|
|
653
|
+
functionReducedUnpack0
|
|
654
|
+
)
|
|
655
|
+
)
|
|
656
|
+
)
|
|
657
|
+
)
|
|
658
|
+
, Tuple.pair
|
|
659
|
+
"update"
|
|
660
|
+
(Elm.functionReduced
|
|
661
|
+
"buildWithLocalStateUnpack"
|
|
662
|
+
(\functionReducedUnpack ->
|
|
663
|
+
Elm.functionReduced
|
|
664
|
+
"unpack"
|
|
665
|
+
(\functionReducedUnpack0 ->
|
|
666
|
+
Elm.functionReduced
|
|
667
|
+
"unpack"
|
|
668
|
+
(\functionReducedUnpack_2_1_2_0_2_2_2_1_0_2_0_0 ->
|
|
669
|
+
Elm.functionReduced
|
|
670
|
+
"unpack"
|
|
671
|
+
(\functionReducedUnpack_2_1_2_1_2_0_2_2_2_1_0_2_0_0 ->
|
|
672
|
+
Elm.functionReduced
|
|
673
|
+
"unpack"
|
|
674
|
+
(buildWithLocalStateArg.update
|
|
675
|
+
functionReducedUnpack
|
|
676
|
+
functionReducedUnpack0
|
|
677
|
+
functionReducedUnpack_2_1_2_0_2_2_2_1_0_2_0_0
|
|
678
|
+
functionReducedUnpack_2_1_2_1_2_0_2_2_2_1_0_2_0_0
|
|
679
|
+
)
|
|
680
|
+
)
|
|
681
|
+
)
|
|
682
|
+
)
|
|
683
|
+
)
|
|
684
|
+
)
|
|
685
|
+
, Tuple.pair
|
|
686
|
+
"subscriptions"
|
|
687
|
+
(Elm.functionReduced
|
|
688
|
+
"buildWithLocalStateUnpack"
|
|
689
|
+
(\functionReducedUnpack ->
|
|
690
|
+
Elm.functionReduced
|
|
691
|
+
"unpack"
|
|
692
|
+
(\functionReducedUnpack0 ->
|
|
693
|
+
Elm.functionReduced
|
|
694
|
+
"unpack"
|
|
695
|
+
(\functionReducedUnpack_2_1_2_0_2_2_3_1_0_2_0_0 ->
|
|
696
|
+
Elm.functionReduced
|
|
697
|
+
"unpack"
|
|
698
|
+
(\functionReducedUnpack_2_1_2_1_2_0_2_2_3_1_0_2_0_0 ->
|
|
699
|
+
Elm.functionReduced
|
|
700
|
+
"unpack"
|
|
701
|
+
(buildWithLocalStateArg.subscriptions
|
|
702
|
+
functionReducedUnpack
|
|
703
|
+
functionReducedUnpack0
|
|
704
|
+
functionReducedUnpack_2_1_2_0_2_2_3_1_0_2_0_0
|
|
705
|
+
functionReducedUnpack_2_1_2_1_2_0_2_2_3_1_0_2_0_0
|
|
706
|
+
)
|
|
707
|
+
)
|
|
708
|
+
)
|
|
709
|
+
)
|
|
710
|
+
)
|
|
711
|
+
)
|
|
712
|
+
]
|
|
713
|
+
, buildWithLocalStateArg0
|
|
714
|
+
]
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
buildNoState_ :
|
|
718
|
+
{ view :
|
|
719
|
+
Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
|
|
720
|
+
}
|
|
721
|
+
-> Elm.Expression
|
|
722
|
+
-> Elm.Expression
|
|
723
|
+
buildNoState_ buildNoStateArg buildNoStateArg0 =
|
|
724
|
+
Elm.apply
|
|
725
|
+
(Elm.value
|
|
726
|
+
{ importFrom = [ "RouteBuilder" ]
|
|
727
|
+
, name = "buildNoState"
|
|
728
|
+
, annotation =
|
|
729
|
+
Just
|
|
730
|
+
(Elm.Annotation.function
|
|
731
|
+
[ Elm.Annotation.record
|
|
732
|
+
[ ( "view"
|
|
733
|
+
, Elm.Annotation.function
|
|
734
|
+
[ Elm.Annotation.maybe
|
|
735
|
+
(Elm.Annotation.namedWith
|
|
736
|
+
[ "Pages", "PageUrl" ]
|
|
737
|
+
"PageUrl"
|
|
738
|
+
[]
|
|
739
|
+
)
|
|
740
|
+
, Elm.Annotation.namedWith [ "Shared" ] "Model" []
|
|
741
|
+
, Elm.Annotation.namedWith
|
|
742
|
+
[ "RouteBuilder" ]
|
|
743
|
+
"StaticPayload"
|
|
744
|
+
[ Elm.Annotation.var "data"
|
|
745
|
+
, Elm.Annotation.var "action"
|
|
746
|
+
, Elm.Annotation.var "routeParams"
|
|
747
|
+
]
|
|
748
|
+
]
|
|
749
|
+
(Elm.Annotation.namedWith
|
|
750
|
+
[ "View" ]
|
|
751
|
+
"View"
|
|
752
|
+
[ Elm.Annotation.namedWith
|
|
753
|
+
[ "Pages", "Msg" ]
|
|
754
|
+
"Msg"
|
|
755
|
+
[ Elm.Annotation.unit ]
|
|
756
|
+
]
|
|
757
|
+
)
|
|
758
|
+
)
|
|
759
|
+
]
|
|
760
|
+
, Elm.Annotation.namedWith
|
|
761
|
+
[ "RouteBuilder" ]
|
|
762
|
+
"Builder"
|
|
763
|
+
[ Elm.Annotation.var "routeParams"
|
|
764
|
+
, Elm.Annotation.var "data"
|
|
765
|
+
, Elm.Annotation.var "action"
|
|
766
|
+
]
|
|
767
|
+
]
|
|
768
|
+
(Elm.Annotation.namedWith
|
|
769
|
+
[ "RouteBuilder" ]
|
|
770
|
+
"StatefulRoute"
|
|
771
|
+
[ Elm.Annotation.var "routeParams"
|
|
772
|
+
, Elm.Annotation.var "data"
|
|
773
|
+
, Elm.Annotation.var "action"
|
|
774
|
+
, Elm.Annotation.record []
|
|
775
|
+
, Elm.Annotation.unit
|
|
776
|
+
]
|
|
777
|
+
)
|
|
778
|
+
)
|
|
779
|
+
}
|
|
780
|
+
)
|
|
781
|
+
[ Elm.record
|
|
782
|
+
[ Tuple.pair
|
|
783
|
+
"view"
|
|
784
|
+
(Elm.functionReduced
|
|
785
|
+
"buildNoStateUnpack"
|
|
786
|
+
(\functionReducedUnpack ->
|
|
787
|
+
Elm.functionReduced
|
|
788
|
+
"unpack"
|
|
789
|
+
(\functionReducedUnpack0 ->
|
|
790
|
+
Elm.functionReduced
|
|
791
|
+
"unpack"
|
|
792
|
+
(buildNoStateArg.view functionReducedUnpack
|
|
793
|
+
functionReducedUnpack0
|
|
794
|
+
)
|
|
795
|
+
)
|
|
796
|
+
)
|
|
797
|
+
)
|
|
798
|
+
]
|
|
799
|
+
, buildNoStateArg0
|
|
800
|
+
]
|