elm-pages 3.0.0-beta.9 → 3.0.0

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 (165) hide show
  1. package/README.md +2 -2
  2. package/adapter/netlify.js +207 -0
  3. package/codegen/{elm-pages-codegen.js → elm-pages-codegen.cjs} +2731 -2939
  4. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateData.elmi +0 -0
  5. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateData.elmo +0 -0
  6. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-DeadCodeEliminateDataTest.elmo +0 -0
  7. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/d.dat +0 -0
  8. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/i.dat +0 -0
  9. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/o.dat +0 -0
  10. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm.json +1 -1
  11. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/Reporter.elm.js +1527 -422
  12. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/Runner.elm.js +16840 -13653
  13. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/node_runner.js +1 -1
  14. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/node_supervisor.js +4 -4
  15. package/generator/dead-code-review/elm.json +9 -7
  16. package/generator/dead-code-review/src/Pages/Review/DeadCodeEliminateData.elm +59 -10
  17. package/generator/dead-code-review/tests/Pages/Review/DeadCodeEliminateDataTest.elm +52 -36
  18. package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Internal-RoutePattern.elmi +0 -0
  19. package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Internal-RoutePattern.elmo +0 -0
  20. package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-NoContractViolations.elmi +0 -0
  21. package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/Pages-Review-NoContractViolations.elmo +0 -0
  22. package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/d.dat +0 -0
  23. package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/i.dat +0 -0
  24. package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/o.dat +0 -0
  25. package/generator/review/elm-stuff/tests-0.19.1/elm.json +1 -1
  26. package/generator/review/elm-stuff/tests-0.19.1/js/Reporter.elm.js +1527 -422
  27. package/generator/review/elm-stuff/tests-0.19.1/js/Runner.elm.js +25118 -21832
  28. package/generator/review/elm-stuff/tests-0.19.1/js/node_runner.js +1 -1
  29. package/generator/review/elm-stuff/tests-0.19.1/js/node_supervisor.js +4 -4
  30. package/generator/review/elm.json +10 -10
  31. package/generator/src/RouteBuilder.elm +93 -128
  32. package/generator/src/SharedTemplate.elm +8 -7
  33. package/generator/src/SiteConfig.elm +3 -2
  34. package/generator/src/basepath-middleware.js +3 -3
  35. package/generator/src/build.js +143 -59
  36. package/generator/src/cli.js +292 -88
  37. package/generator/src/codegen.js +29 -27
  38. package/generator/src/compatibility-key.js +3 -0
  39. package/generator/src/compile-elm.js +43 -26
  40. package/generator/src/config.js +2 -4
  41. package/generator/src/copy-dir.js +2 -2
  42. package/generator/src/dev-server.js +160 -102
  43. package/generator/src/dir-helpers.js +9 -26
  44. package/generator/src/elm-codegen.js +5 -4
  45. package/generator/src/elm-file-constants.js +2 -3
  46. package/generator/src/error-formatter.js +12 -11
  47. package/generator/src/file-helpers.js +3 -4
  48. package/generator/src/generate-template-module-connector.js +23 -23
  49. package/generator/src/init.js +9 -8
  50. package/generator/src/pre-render-html.js +10 -13
  51. package/generator/src/render-test.js +109 -0
  52. package/generator/src/render-worker.js +25 -28
  53. package/generator/src/render.js +320 -143
  54. package/generator/src/request-cache.js +265 -162
  55. package/generator/src/resolve-elm-module.js +64 -0
  56. package/generator/src/rewrite-client-elm-json.js +6 -5
  57. package/generator/src/rewrite-elm-json-help.js +56 -0
  58. package/generator/src/rewrite-elm-json.js +17 -7
  59. package/generator/src/route-codegen-helpers.js +16 -31
  60. package/generator/src/seo-renderer.js +1 -3
  61. package/generator/src/vite-utils.js +1 -2
  62. package/generator/static-code/elm-pages.js +10 -0
  63. package/generator/static-code/hmr.js +79 -13
  64. package/generator/template/app/Api.elm +3 -2
  65. package/generator/template/app/Effect.elm +155 -0
  66. package/generator/template/app/ErrorPage.elm +49 -6
  67. package/generator/template/app/Route/Blog/Slug_.elm +86 -0
  68. package/generator/template/app/Route/Greet.elm +107 -0
  69. package/generator/template/app/Route/Hello.elm +119 -0
  70. package/generator/template/app/Route/Index.elm +26 -25
  71. package/generator/template/app/Shared.elm +38 -39
  72. package/generator/template/app/Site.elm +4 -7
  73. package/generator/template/app/View.elm +9 -8
  74. package/generator/template/codegen/elm.codegen.json +18 -0
  75. package/generator/template/custom-backend-task.ts +3 -0
  76. package/generator/template/elm-pages.config.mjs +13 -0
  77. package/generator/template/elm-tooling.json +0 -3
  78. package/generator/template/elm.json +25 -20
  79. package/generator/template/index.ts +1 -2
  80. package/generator/template/netlify.toml +4 -1
  81. package/generator/template/package.json +10 -4
  82. package/generator/template/script/.elm-pages/compiled-ports/custom-backend-task.mjs +7 -0
  83. package/generator/template/script/custom-backend-task.ts +3 -0
  84. package/generator/template/script/elm.json +61 -0
  85. package/generator/template/script/src/AddRoute.elm +312 -0
  86. package/generator/template/script/src/Stars.elm +42 -0
  87. package/package.json +30 -27
  88. package/src/ApiRoute.elm +249 -82
  89. package/src/BackendTask/Custom.elm +325 -0
  90. package/src/BackendTask/Env.elm +90 -0
  91. package/src/{DataSource → BackendTask}/File.elm +171 -56
  92. package/src/{DataSource → BackendTask}/Glob.elm +136 -125
  93. package/src/BackendTask/Http.elm +679 -0
  94. package/src/{DataSource → BackendTask}/Internal/Glob.elm +1 -1
  95. package/src/BackendTask/Internal/Request.elm +69 -0
  96. package/src/BackendTask/Random.elm +79 -0
  97. package/src/BackendTask/Time.elm +47 -0
  98. package/src/BackendTask.elm +531 -0
  99. package/src/FatalError.elm +90 -0
  100. package/src/FormData.elm +21 -18
  101. package/src/Head/Seo.elm +4 -4
  102. package/src/Head.elm +112 -8
  103. package/src/Internal/ApiRoute.elm +7 -5
  104. package/src/Internal/Request.elm +84 -4
  105. package/src/PageServerResponse.elm +6 -1
  106. package/src/Pages/ConcurrentSubmission.elm +127 -0
  107. package/src/Pages/Form.elm +340 -0
  108. package/src/Pages/FormData.elm +19 -0
  109. package/src/Pages/GeneratorProgramConfig.elm +15 -0
  110. package/src/Pages/Internal/FatalError.elm +5 -0
  111. package/src/Pages/Internal/Msg.elm +93 -0
  112. package/src/Pages/Internal/NotFoundReason.elm +4 -4
  113. package/src/Pages/Internal/Platform/Cli.elm +586 -768
  114. package/src/Pages/Internal/Platform/CompatibilityKey.elm +1 -1
  115. package/src/Pages/Internal/Platform/Effect.elm +1 -2
  116. package/src/Pages/Internal/Platform/GeneratorApplication.elm +379 -0
  117. package/src/Pages/Internal/Platform/StaticResponses.elm +65 -276
  118. package/src/Pages/Internal/Platform/ToJsPayload.elm +6 -9
  119. package/src/Pages/Internal/Platform.elm +330 -203
  120. package/src/Pages/Internal/ResponseSketch.elm +2 -2
  121. package/src/Pages/Internal/Script.elm +17 -0
  122. package/src/Pages/Internal/StaticHttpBody.elm +35 -1
  123. package/src/Pages/Manifest.elm +52 -11
  124. package/src/Pages/Navigation.elm +85 -0
  125. package/src/Pages/PageUrl.elm +26 -12
  126. package/src/Pages/ProgramConfig.elm +32 -22
  127. package/src/Pages/Script.elm +166 -0
  128. package/src/Pages/SiteConfig.elm +3 -2
  129. package/src/Pages/StaticHttp/Request.elm +2 -2
  130. package/src/Pages/StaticHttpRequest.elm +23 -99
  131. package/src/Pages/Url.elm +3 -3
  132. package/src/PagesMsg.elm +88 -0
  133. package/src/QueryParams.elm +21 -172
  134. package/src/RenderRequest.elm +7 -7
  135. package/src/RequestsAndPending.elm +37 -20
  136. package/src/Result/Extra.elm +26 -0
  137. package/src/Scaffold/Form.elm +569 -0
  138. package/src/Scaffold/Route.elm +1431 -0
  139. package/src/Server/Request.elm +476 -1001
  140. package/src/Server/Response.elm +130 -36
  141. package/src/Server/Session.elm +181 -111
  142. package/src/Server/SetCookie.elm +80 -32
  143. package/src/Stub.elm +53 -0
  144. package/src/Test/Html/Internal/ElmHtml/ToString.elm +8 -9
  145. package/src/{Path.elm → UrlPath.elm} +33 -36
  146. package/generator/template/public/images/icon-png.png +0 -0
  147. package/src/DataSource/Env.elm +0 -38
  148. package/src/DataSource/Http.elm +0 -446
  149. package/src/DataSource/Internal/Request.elm +0 -20
  150. package/src/DataSource/Port.elm +0 -90
  151. package/src/DataSource.elm +0 -546
  152. package/src/Form/Field.elm +0 -717
  153. package/src/Form/FieldStatus.elm +0 -36
  154. package/src/Form/FieldView.elm +0 -417
  155. package/src/Form/FormData.elm +0 -22
  156. package/src/Form/Validation.elm +0 -391
  157. package/src/Form/Value.elm +0 -118
  158. package/src/Form.elm +0 -1683
  159. package/src/FormDecoder.elm +0 -102
  160. package/src/Pages/FormState.elm +0 -256
  161. package/src/Pages/Generate.elm +0 -1242
  162. package/src/Pages/Internal/Form.elm +0 -17
  163. package/src/Pages/Internal/Platform/Cli.elm.bak +0 -1276
  164. package/src/Pages/Msg.elm +0 -79
  165. package/src/Pages/Transition.elm +0 -70
@@ -1,1242 +0,0 @@
1
- module Pages.Generate exposing
2
- ( buildWithLocalState, buildWithSharedState, buildNoState, Builder
3
- , Type(..)
4
- , serverRender
5
- , preRender, single
6
- )
7
-
8
- {-|
9
-
10
-
11
- ## Initializing the Generator Builder
12
-
13
- @docs buildWithLocalState, buildWithSharedState, buildNoState, Builder
14
-
15
- @docs Type
16
-
17
-
18
- ## Generating Server-Rendered Pages
19
-
20
- @docs serverRender
21
-
22
-
23
- ## Generating pre-rendered pages
24
-
25
- @docs preRender, single
26
-
27
- -}
28
-
29
- import Elm
30
- import Elm.Annotation
31
- import Elm.Declare
32
- import Pages.Internal.RoutePattern as RoutePattern
33
-
34
-
35
- {-| -}
36
- type Type
37
- = Alias Elm.Annotation.Annotation
38
- | Custom (List Elm.Variant)
39
-
40
-
41
- typeToDeclaration : String -> Type -> Elm.Declaration
42
- typeToDeclaration name type_ =
43
- case type_ of
44
- Alias annotation ->
45
- Elm.alias name annotation
46
-
47
- Custom variants ->
48
- Elm.customType name variants
49
-
50
-
51
- {-| -}
52
- type Builder
53
- = ServerRender
54
- { data : ( Type, Elm.Expression -> Elm.Expression )
55
- , action : ( Type, Elm.Expression -> Elm.Expression )
56
- , head : Elm.Expression -> Elm.Expression
57
- , moduleName : List String
58
- }
59
- | PreRender
60
- { data : ( Type, Elm.Expression -> Elm.Expression )
61
- , pages : Maybe Elm.Expression
62
- , head : Elm.Expression -> Elm.Expression
63
- , moduleName : List String
64
- }
65
-
66
-
67
- {-| -}
68
- serverRender :
69
- { data : ( Type, Elm.Expression -> Elm.Expression )
70
- , action : ( Type, Elm.Expression -> Elm.Expression )
71
- , head : Elm.Expression -> Elm.Expression
72
- , moduleName : List String
73
- }
74
- -> Builder
75
- serverRender =
76
- ServerRender
77
-
78
-
79
- {-| -}
80
- preRender :
81
- { data : ( Type, Elm.Expression -> Elm.Expression )
82
- , pages : Elm.Expression
83
- , head : Elm.Expression -> Elm.Expression
84
- , moduleName : List String
85
- }
86
- -> Builder
87
- preRender input =
88
- --let
89
- -- hasDynamicRouteSegments : Bool
90
- -- hasDynamicRouteSegments =
91
- -- RoutePattern.fromModuleName input.moduleName
92
- -- -- TODO give error if not parseable here
93
- -- |> Maybe.map RoutePattern.hasRouteParams
94
- -- |> Maybe.withDefault False
95
- --in
96
- PreRender
97
- { data = input.data
98
- , pages =
99
- input.pages
100
- |> Elm.withType
101
- (Elm.Annotation.namedWith [ "DataSource" ]
102
- "DataSource"
103
- [ Elm.Annotation.list <| Elm.Annotation.named [] "RouteParams"
104
- ]
105
- )
106
- |> Just
107
- , head = input.head
108
- , moduleName = input.moduleName
109
- }
110
-
111
-
112
- {-| -}
113
- single :
114
- { data : ( Type, Elm.Expression )
115
- , head : Elm.Expression -> Elm.Expression
116
- , moduleName : List String
117
- }
118
- -> Builder
119
- single input =
120
- PreRender
121
- { data = ( Tuple.first input.data, \_ -> Tuple.second input.data )
122
- , pages = Nothing
123
- , head = input.head
124
- , moduleName = input.moduleName
125
- }
126
-
127
-
128
- {-| -}
129
- buildNoState :
130
- { view : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
131
- }
132
- -> Builder
133
- -> Elm.File
134
- buildNoState definitions builder_ =
135
- case builder_ of
136
- ServerRender builder ->
137
- userFunction builder.moduleName
138
- { view = \_ -> definitions.view
139
- , localState = Nothing
140
- , data = builder.data |> Tuple.second
141
- , action = builder.action |> Tuple.second |> Action
142
- , head = builder.head
143
- , types =
144
- { model = Alias (Elm.Annotation.record [])
145
- , msg = Alias Elm.Annotation.unit
146
- , data = builder.data |> Tuple.first
147
- , actionData = builder.action |> Tuple.first
148
- }
149
- }
150
-
151
- PreRender builder ->
152
- userFunction builder.moduleName
153
- { view = \_ -> definitions.view
154
- , localState = Nothing
155
- , data = builder.data |> Tuple.second
156
- , action = builder.pages |> Pages
157
- , head = builder.head
158
- , types =
159
- { model = Alias (Elm.Annotation.record [])
160
- , msg = Alias Elm.Annotation.unit
161
- , data = builder.data |> Tuple.first
162
- , actionData =
163
- Elm.Annotation.namedWith [ "DataSource" ]
164
- "DataSource"
165
- [ Elm.Annotation.list (Elm.Annotation.named [] "RouteParams")
166
- ]
167
- |> Alias
168
- }
169
- }
170
-
171
-
172
- {-| -}
173
- buildWithLocalState :
174
- { view : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
175
- , update : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
176
- , init : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
177
- , subscriptions : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
178
- , msg : Type
179
- , model : Type
180
- }
181
- -> Builder
182
- -> Elm.File
183
- buildWithLocalState definitions builder_ =
184
- case builder_ of
185
- ServerRender builder ->
186
- userFunction builder.moduleName
187
- { view = definitions.view
188
- , localState =
189
- Just
190
- { update = definitions.update
191
- , init = definitions.init
192
- , subscriptions = definitions.subscriptions
193
- , state = LocalState
194
- }
195
- , data = builder.data |> Tuple.second
196
- , action = builder.action |> Tuple.second |> Action
197
- , head = builder.head
198
- , types =
199
- { model = definitions.model
200
- , msg = definitions.msg
201
- , data = builder.data |> Tuple.first
202
- , actionData = builder.action |> Tuple.first
203
- }
204
- }
205
-
206
- PreRender builder ->
207
- userFunction builder.moduleName
208
- { view = definitions.view
209
- , localState =
210
- Just
211
- { update = definitions.update
212
- , init = definitions.init
213
- , subscriptions = definitions.subscriptions
214
- , state = LocalState
215
- }
216
- , data = builder.data |> Tuple.second
217
- , action = builder.pages |> Pages
218
- , head = builder.head
219
- , types =
220
- { model = definitions.model
221
- , msg = definitions.msg
222
- , data = builder.data |> Tuple.first
223
- , actionData =
224
- Elm.Annotation.namedWith [ "DataSource" ]
225
- "DataSource"
226
- [ Elm.Annotation.list (Elm.Annotation.named [] "RouteParams")
227
- ]
228
- |> Alias
229
- }
230
- }
231
-
232
-
233
- {-| -}
234
- buildWithSharedState :
235
- { view : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
236
- , update : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
237
- , init : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
238
- , subscriptions : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
239
- , msg : Type
240
- , model : Type
241
- }
242
- -> Builder
243
- -> Elm.File
244
- buildWithSharedState definitions builder_ =
245
- case builder_ of
246
- ServerRender builder ->
247
- userFunction builder.moduleName
248
- { view = definitions.view
249
- , localState =
250
- Just
251
- { update = definitions.update
252
- , init = definitions.init
253
- , subscriptions = definitions.subscriptions
254
- , state = SharedState
255
- }
256
- , data = builder.data |> Tuple.second
257
- , action = builder.action |> Tuple.second |> Action
258
- , head = builder.head
259
- , types =
260
- { model = definitions.model
261
- , msg = definitions.msg
262
- , data = builder.data |> Tuple.first
263
- , actionData = builder.action |> Tuple.first
264
- }
265
- }
266
-
267
- PreRender builder ->
268
- userFunction builder.moduleName
269
- { view = definitions.view
270
- , localState =
271
- Just
272
- { update = definitions.update
273
- , init = definitions.init
274
- , subscriptions = definitions.subscriptions
275
- , state = SharedState
276
- }
277
- , data = builder.data |> Tuple.second
278
- , action = builder.pages |> Pages
279
- , head = builder.head
280
- , types =
281
- { model = definitions.model
282
- , msg = definitions.msg
283
- , data = builder.data |> Tuple.first
284
- , actionData =
285
- Elm.Annotation.namedWith [ "DataSource" ]
286
- "DataSource"
287
- [ Elm.Annotation.list (Elm.Annotation.named [] "RouteParams")
288
- ]
289
- |> Alias
290
- }
291
- }
292
-
293
-
294
- type State
295
- = SharedState
296
- | LocalState
297
-
298
-
299
- type ActionOrPages
300
- = Action (Elm.Expression -> Elm.Expression)
301
- | Pages (Maybe Elm.Expression)
302
-
303
-
304
- {-| -}
305
- userFunction :
306
- List String
307
- ->
308
- { view : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
309
- , localState :
310
- Maybe
311
- { update : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
312
- , init : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
313
- , subscriptions : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
314
- , state : State
315
- }
316
- , data : Elm.Expression -> Elm.Expression
317
- , action : ActionOrPages
318
- , head : Elm.Expression -> Elm.Expression
319
- , types : { model : Type, msg : Type, data : Type, actionData : Type }
320
- }
321
- -> Elm.File
322
- userFunction moduleName definitions =
323
- let
324
- viewFn :
325
- { declaration : Elm.Declaration
326
- , call : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
327
- , callFrom : List String -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
328
- }
329
- viewFn =
330
- case definitions.localState of
331
- Just _ ->
332
- Elm.Declare.fn4 "view"
333
- ( "maybeUrl"
334
- , "PageUrl"
335
- |> Elm.Annotation.named [ "Pages", "PageUrl" ]
336
- |> Elm.Annotation.maybe
337
- |> Just
338
- )
339
- ( "sharedModel"
340
- , Nothing
341
- )
342
- ( "model", Just (Elm.Annotation.named [] "Model") )
343
- ( "app", Just appType )
344
- definitions.view
345
-
346
- Nothing ->
347
- let
348
- viewDeclaration :
349
- { declaration : Elm.Declaration
350
- , call : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
351
- , callFrom : List String -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
352
- }
353
- viewDeclaration =
354
- Elm.Declare.fn3 "view"
355
- ( "maybeUrl"
356
- , "PageUrl"
357
- |> Elm.Annotation.named [ "Pages", "PageUrl" ]
358
- |> Elm.Annotation.maybe
359
- |> Just
360
- )
361
- ( "sharedModel"
362
- , Nothing
363
- )
364
- ( "app", Just appType )
365
- (definitions.view Elm.unit)
366
- in
367
- { declaration = viewDeclaration.declaration
368
- , call = \_ -> viewDeclaration.call
369
- , callFrom = \a _ c d -> viewDeclaration.callFrom a c d
370
- }
371
-
372
- localDefinitions :
373
- Maybe
374
- { updateFn :
375
- { declaration : Elm.Declaration
376
- , call : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
377
- , callFrom : List String -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
378
- }
379
- , initFn : { declaration : Elm.Declaration, call : Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression, callFrom : List String -> Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression }
380
- , 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 }
381
- , state : State
382
- }
383
- localDefinitions =
384
- definitions.localState
385
- |> Maybe.map
386
- (\localState ->
387
- { updateFn =
388
- Elm.Declare.fn5 "update"
389
- ( "pageUrl"
390
- , "PageUrl"
391
- |> Elm.Annotation.named [ "Pages", "PageUrl" ]
392
- |> Just
393
- )
394
- ( "sharedModel", Nothing )
395
- ( "app", Just appType )
396
- ( "msg", Just (Elm.Annotation.named [] "Msg") )
397
- ( "model", Just (Elm.Annotation.named [] "Model") )
398
- localState.update
399
- , initFn =
400
- Elm.Declare.fn3 "init"
401
- ( "pageUrl"
402
- , "PageUrl"
403
- |> Elm.Annotation.named [ "Pages", "PageUrl" ]
404
- |> Elm.Annotation.maybe
405
- |> Just
406
- )
407
- ( "sharedModel", Nothing )
408
- ( "app", Just appType )
409
- localState.init
410
- , subscriptionsFn =
411
- Elm.Declare.fn5
412
- "subscriptions"
413
- ( "maybePageUrl"
414
- , "PageUrl"
415
- |> Elm.Annotation.named [ "Pages", "PageUrl" ]
416
- |> Elm.Annotation.maybe
417
- |> Just
418
- )
419
- ( "routeParams", Nothing )
420
- ( "path", Nothing )
421
- ( "sharedModel", Nothing )
422
- ( "model", Nothing )
423
- localState.subscriptions
424
- , state = localState.state
425
- }
426
- )
427
-
428
- dataFn : { declaration : Elm.Declaration, call : List Elm.Expression -> Elm.Expression, callFrom : List String -> List Elm.Expression -> Elm.Expression }
429
- dataFn =
430
- case definitions.action of
431
- Pages Nothing ->
432
- Elm.Declare.function "data"
433
- []
434
- (\_ ->
435
- definitions.data Elm.unit
436
- |> Elm.withType
437
- (case definitions.action of
438
- Pages _ ->
439
- Elm.Annotation.namedWith [ "DataSource" ]
440
- "DataSource"
441
- [ Elm.Annotation.named [] "Data"
442
- ]
443
-
444
- Action _ ->
445
- myType "Data"
446
- )
447
- )
448
-
449
- _ ->
450
- Elm.Declare.function "data"
451
- [ ( "routeParams"
452
- , "RouteParams"
453
- |> Elm.Annotation.named []
454
- |> Just
455
- )
456
- ]
457
- (\args ->
458
- case args of
459
- [ arg ] ->
460
- definitions.data arg
461
- |> Elm.withType
462
- (case definitions.action of
463
- Pages _ ->
464
- Elm.Annotation.namedWith [ "DataSource" ]
465
- "DataSource"
466
- [ Elm.Annotation.named [] "Data"
467
- ]
468
-
469
- Action _ ->
470
- myType "Data"
471
- )
472
-
473
- _ ->
474
- Elm.unit
475
- )
476
-
477
- actionFn : Maybe { declaration : Elm.Declaration, call : List Elm.Expression -> Elm.Expression, callFrom : List String -> List Elm.Expression -> Elm.Expression }
478
- actionFn =
479
- case definitions.action of
480
- Action action_ ->
481
- Elm.Declare.function "action"
482
- [ ( "routeParams"
483
- , "RouteParams"
484
- |> Elm.Annotation.named []
485
- |> Just
486
- )
487
- ]
488
- (\args ->
489
- case args of
490
- [ arg ] ->
491
- action_ arg |> Elm.withType (myType "ActionData")
492
-
493
- _ ->
494
- Elm.unit
495
- )
496
- |> Just
497
-
498
- Pages pages_ ->
499
- pages_
500
- |> Maybe.map
501
- (\justPagesExpression ->
502
- Elm.Declare.function "pages"
503
- []
504
- (\_ -> justPagesExpression)
505
- )
506
-
507
- headFn : { declaration : Elm.Declaration, call : Elm.Expression -> Elm.Expression, callFrom : List String -> Elm.Expression -> Elm.Expression }
508
- headFn =
509
- Elm.Declare.fn "head"
510
- ( "app", Just appType )
511
- (definitions.head
512
- >> Elm.withType
513
- (Elm.Annotation.list
514
- (Elm.Annotation.named [ "Head" ] "Tag")
515
- )
516
- )
517
- in
518
- Elm.file ("Route" :: moduleName)
519
- ([ definitions.types.model |> typeToDeclaration "Model"
520
- , definitions.types.msg |> typeToDeclaration "Msg"
521
- , Elm.alias "RouteParams"
522
- (Elm.Annotation.record
523
- (RoutePattern.fromModuleName moduleName
524
- -- TODO give error if not parseable here
525
- |> Maybe.map RoutePattern.toRouteParamsRecord
526
- |> Maybe.withDefault []
527
- )
528
- )
529
- , Elm.declaration "route"
530
- (case definitions.action of
531
- Action _ ->
532
- serverRender_
533
- { action =
534
- \routeParams ->
535
- actionFn
536
- |> Maybe.map
537
- (\justActionFn ->
538
- justActionFn.call [ routeParams ]
539
- |> Elm.withType (myType "ActionData")
540
- )
541
- |> Maybe.withDefault Elm.unit
542
- , data =
543
- \routeParams ->
544
- dataFn.call [ routeParams ]
545
- |> Elm.withType (myType "Data")
546
- , head = headFn.call
547
- }
548
-
549
- Pages _ ->
550
- (case actionFn of
551
- Nothing ->
552
- single_
553
- { data =
554
- dataFn.call []
555
- |> Elm.withType
556
- (Elm.Annotation.namedWith [ "DataSource" ]
557
- "DataSource"
558
- [ Elm.Annotation.named [] "Data"
559
- ]
560
- )
561
- , head = headFn.call
562
- }
563
-
564
- Just justActionFn ->
565
- preRender_
566
- { pages = justActionFn.call []
567
- , data =
568
- \routeParams ->
569
- dataFn.call [ routeParams ]
570
- |> Elm.withType
571
- (Elm.Annotation.namedWith [ "DataSource" ]
572
- "DataSource"
573
- [ Elm.Annotation.named [] "Data"
574
- ]
575
- )
576
- , head = headFn.call
577
- }
578
- )
579
- |> (case localDefinitions of
580
- Just local ->
581
- buildWithLocalState_
582
- { view = viewFn.call
583
- , update = local.updateFn.call
584
- , init = local.initFn.call
585
- , subscriptions = local.subscriptionsFn.call
586
- , state = local.state
587
- }
588
- >> Elm.withType
589
- (Elm.Annotation.namedWith [ "RouteBuilder" ]
590
- "StatefulRoute"
591
- [ localType "RouteParams"
592
- , localType "Data"
593
- , localType "ActionData"
594
- , localType "Model"
595
- , localType "Msg"
596
- ]
597
- )
598
-
599
- Nothing ->
600
- buildNoState_
601
- { view = viewFn.call Elm.unit
602
- }
603
- >> Elm.withType
604
- (Elm.Annotation.namedWith [ "RouteBuilder" ]
605
- "StatelessRoute"
606
- [ localType "RouteParams"
607
- , localType "Data"
608
- , localType "ActionData"
609
- ]
610
- )
611
- )
612
- )
613
- ]
614
- ++ (case localDefinitions of
615
- Just local ->
616
- [ local.initFn.declaration
617
- , local.updateFn.declaration
618
- , local.subscriptionsFn.declaration
619
- ]
620
-
621
- Nothing ->
622
- []
623
- )
624
- ++ [ definitions.types.data |> typeToDeclaration "Data"
625
- , definitions.types.actionData |> typeToDeclaration "ActionData"
626
- , dataFn.declaration
627
- , headFn.declaration
628
- , viewFn.declaration
629
- ]
630
- ++ ([ actionFn |> Maybe.map .declaration
631
- ]
632
- |> List.filterMap identity
633
- )
634
- )
635
-
636
-
637
- localType : String -> Elm.Annotation.Annotation
638
- localType =
639
- Elm.Annotation.named []
640
-
641
-
642
- myType : String -> Elm.Annotation.Annotation
643
- myType dataType =
644
- Elm.Annotation.namedWith [ "Server", "Request" ]
645
- "Parser"
646
- [ Elm.Annotation.namedWith [ "DataSource" ]
647
- "DataSource"
648
- [ Elm.Annotation.namedWith [ "Server", "Response" ]
649
- "Response"
650
- [ Elm.Annotation.named [] dataType
651
- , Elm.Annotation.named [ "ErrorPage" ] "ErrorPage"
652
- ]
653
- ]
654
- ]
655
-
656
-
657
- appType : Elm.Annotation.Annotation
658
- appType =
659
- Elm.Annotation.namedWith [ "RouteBuilder" ]
660
- "StaticPayload"
661
- [ Elm.Annotation.named [] "Data"
662
- , Elm.Annotation.named [] "ActionData"
663
- , Elm.Annotation.named [] "RouteParams"
664
- ]
665
-
666
-
667
- serverRender_ :
668
- { data : Elm.Expression -> Elm.Expression
669
- , action : Elm.Expression -> Elm.Expression
670
- , head : Elm.Expression -> Elm.Expression
671
- }
672
- -> Elm.Expression
673
- serverRender_ serverRenderArg =
674
- Elm.apply
675
- (Elm.value
676
- { importFrom = [ "RouteBuilder" ]
677
- , name = "serverRender"
678
- , annotation =
679
- Just
680
- (Elm.Annotation.function
681
- [ Elm.Annotation.record
682
- [ ( "data"
683
- , Elm.Annotation.function
684
- [ Elm.Annotation.var "routeParams" ]
685
- (Elm.Annotation.namedWith
686
- [ "Server", "Request" ]
687
- "Parser"
688
- [ Elm.Annotation.namedWith
689
- [ "DataSource" ]
690
- "DataSource"
691
- [ Elm.Annotation.namedWith
692
- [ "Server", "Response" ]
693
- "Response"
694
- [ Elm.Annotation.var "data"
695
- , Elm.Annotation.namedWith
696
- [ "ErrorPage" ]
697
- "ErrorPage"
698
- []
699
- ]
700
- ]
701
- ]
702
- )
703
- )
704
- , ( "action"
705
- , Elm.Annotation.function
706
- [ Elm.Annotation.var "routeParams" ]
707
- (Elm.Annotation.namedWith
708
- [ "Server", "Request" ]
709
- "Parser"
710
- [ Elm.Annotation.namedWith
711
- [ "DataSource" ]
712
- "DataSource"
713
- [ Elm.Annotation.namedWith
714
- [ "Server", "Response" ]
715
- "Response"
716
- [ Elm.Annotation.var "action"
717
- , Elm.Annotation.namedWith
718
- [ "ErrorPage" ]
719
- "ErrorPage"
720
- []
721
- ]
722
- ]
723
- ]
724
- )
725
- )
726
- , ( "head"
727
- , Elm.Annotation.function
728
- [ Elm.Annotation.namedWith
729
- [ "RouteBuilder" ]
730
- "StaticPayload"
731
- [ Elm.Annotation.var "data"
732
- , Elm.Annotation.var "action"
733
- , Elm.Annotation.var "routeParams"
734
- ]
735
- ]
736
- (Elm.Annotation.list
737
- (Elm.Annotation.namedWith [ "Head" ] "Tag" [])
738
- )
739
- )
740
- ]
741
- ]
742
- (Elm.Annotation.namedWith
743
- [ "RouteBuilder" ]
744
- "Builder"
745
- [ Elm.Annotation.var "routeParams"
746
- , Elm.Annotation.var "data"
747
- , Elm.Annotation.var "action"
748
- ]
749
- )
750
- )
751
- }
752
- )
753
- [ Elm.record
754
- [ Tuple.pair
755
- "data"
756
- (Elm.functionReduced "serverRenderUnpack" serverRenderArg.data)
757
- , Tuple.pair
758
- "action"
759
- (Elm.functionReduced "serverRenderUnpack" serverRenderArg.action)
760
- , Tuple.pair
761
- "head"
762
- (Elm.functionReduced "serverRenderUnpack" serverRenderArg.head)
763
- ]
764
- ]
765
-
766
-
767
- preRender_ :
768
- { data : Elm.Expression -> Elm.Expression
769
- , pages : Elm.Expression
770
- , head : Elm.Expression -> Elm.Expression
771
- }
772
- -> Elm.Expression
773
- preRender_ serverRenderArg =
774
- Elm.apply
775
- (Elm.value
776
- { importFrom = [ "RouteBuilder" ]
777
- , name = "preRender"
778
- , annotation =
779
- Just
780
- (Elm.Annotation.function
781
- [ Elm.Annotation.record
782
- [ ( "data"
783
- , Elm.Annotation.function
784
- [ Elm.Annotation.var "routeParams" ]
785
- (Elm.Annotation.namedWith
786
- [ "DataSource" ]
787
- "DataSource"
788
- [ Elm.Annotation.var "data"
789
- ]
790
- )
791
- )
792
- , ( "pages"
793
- , Elm.Annotation.namedWith
794
- [ "DataSource" ]
795
- "DataSource"
796
- [ Elm.Annotation.list (Elm.Annotation.named [] "RouteParams")
797
- ]
798
- )
799
- , ( "head"
800
- , Elm.Annotation.function
801
- [ Elm.Annotation.namedWith
802
- [ "RouteBuilder" ]
803
- "StaticPayload"
804
- [ Elm.Annotation.var "data"
805
- , Elm.Annotation.var "action"
806
- , Elm.Annotation.var "routeParams"
807
- ]
808
- ]
809
- (Elm.Annotation.list
810
- (Elm.Annotation.namedWith [ "Head" ] "Tag" [])
811
- )
812
- )
813
- ]
814
- ]
815
- (Elm.Annotation.namedWith
816
- [ "RouteBuilder" ]
817
- "Builder"
818
- [ Elm.Annotation.named [] "RouteParams"
819
- , Elm.Annotation.named [] "Data"
820
- , Elm.Annotation.named [] "Action"
821
- ]
822
- )
823
- )
824
- }
825
- )
826
- [ Elm.record
827
- [ Tuple.pair "data" (Elm.functionReduced "serverRenderUnpack" serverRenderArg.data)
828
- , Tuple.pair "pages" serverRenderArg.pages
829
- , Tuple.pair "head" (Elm.functionReduced "serverRenderUnpack" serverRenderArg.head)
830
- ]
831
- ]
832
-
833
-
834
- single_ :
835
- { data : Elm.Expression
836
- , head : Elm.Expression -> Elm.Expression
837
- }
838
- -> Elm.Expression
839
- single_ serverRenderArg =
840
- Elm.apply
841
- (Elm.value
842
- { importFrom = [ "RouteBuilder" ]
843
- , name = "single"
844
- , annotation =
845
- Just
846
- (Elm.Annotation.function
847
- [ Elm.Annotation.record
848
- [ ( "data"
849
- , Elm.Annotation.namedWith
850
- [ "DataSource" ]
851
- "DataSource"
852
- [ Elm.Annotation.var "data"
853
- ]
854
- )
855
- , ( "head"
856
- , Elm.Annotation.function
857
- [ Elm.Annotation.namedWith
858
- [ "RouteBuilder" ]
859
- "StaticPayload"
860
- [ Elm.Annotation.var "data"
861
- , Elm.Annotation.var "action"
862
- , Elm.Annotation.var "routeParams"
863
- ]
864
- ]
865
- (Elm.Annotation.list
866
- (Elm.Annotation.namedWith [ "Head" ] "Tag" [])
867
- )
868
- )
869
- ]
870
- ]
871
- (Elm.Annotation.namedWith
872
- [ "RouteBuilder" ]
873
- "Builder"
874
- [ Elm.Annotation.named [] "RouteParams"
875
- , Elm.Annotation.named [] "Data"
876
- , Elm.Annotation.named [] "Action"
877
- ]
878
- )
879
- )
880
- }
881
- )
882
- [ Elm.record
883
- [ Tuple.pair "data" serverRenderArg.data
884
- , Tuple.pair "head" (Elm.functionReduced "serverRenderUnpack" serverRenderArg.head)
885
- ]
886
- ]
887
-
888
-
889
- buildWithLocalState_ :
890
- { view :
891
- Elm.Expression
892
- -> Elm.Expression
893
- -> Elm.Expression
894
- -> Elm.Expression
895
- -> Elm.Expression
896
- , init :
897
- Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
898
- , update :
899
- Elm.Expression
900
- -> Elm.Expression
901
- -> Elm.Expression
902
- -> Elm.Expression
903
- -> Elm.Expression
904
- -> Elm.Expression
905
- , subscriptions :
906
- Elm.Expression
907
- -> Elm.Expression
908
- -> Elm.Expression
909
- -> Elm.Expression
910
- -> Elm.Expression
911
- -> Elm.Expression
912
- , state : State
913
- }
914
- -> Elm.Expression
915
- -> Elm.Expression
916
- buildWithLocalState_ buildWithLocalStateArg buildWithLocalStateArg0 =
917
- Elm.apply
918
- (Elm.value
919
- { importFrom = [ "RouteBuilder" ]
920
- , name =
921
- case buildWithLocalStateArg.state of
922
- LocalState ->
923
- "buildWithLocalState"
924
-
925
- SharedState ->
926
- "buildWithSharedState"
927
- , annotation =
928
- Just
929
- (Elm.Annotation.function
930
- [ Elm.Annotation.record
931
- [ ( "view"
932
- , Elm.Annotation.function
933
- [ Elm.Annotation.maybe
934
- (Elm.Annotation.namedWith
935
- [ "Pages", "PageUrl" ]
936
- "PageUrl"
937
- []
938
- )
939
- , Elm.Annotation.namedWith [ "Shared" ] "Model" []
940
- , Elm.Annotation.var "model"
941
- , Elm.Annotation.namedWith
942
- [ "RouteBuilder" ]
943
- "StaticPayload"
944
- [ Elm.Annotation.var "data"
945
- , Elm.Annotation.var "action"
946
- , Elm.Annotation.var "routeParams"
947
- ]
948
- ]
949
- (Elm.Annotation.namedWith
950
- [ "View" ]
951
- "View"
952
- [ Elm.Annotation.namedWith
953
- [ "Pages", "Msg" ]
954
- "Msg"
955
- [ Elm.Annotation.var "msg" ]
956
- ]
957
- )
958
- )
959
- , ( "init"
960
- , Elm.Annotation.function
961
- [ Elm.Annotation.maybe
962
- (Elm.Annotation.namedWith
963
- [ "Pages", "PageUrl" ]
964
- "PageUrl"
965
- []
966
- )
967
- , Elm.Annotation.namedWith [ "Shared" ] "Model" []
968
- , Elm.Annotation.namedWith
969
- [ "RouteBuilder" ]
970
- "StaticPayload"
971
- [ Elm.Annotation.var "data"
972
- , Elm.Annotation.var "action"
973
- , Elm.Annotation.var "routeParams"
974
- ]
975
- ]
976
- (Elm.Annotation.tuple
977
- (Elm.Annotation.var "model")
978
- (Elm.Annotation.namedWith
979
- [ "Effect" ]
980
- "Effect"
981
- [ Elm.Annotation.var "msg" ]
982
- )
983
- )
984
- )
985
- , ( "update"
986
- , Elm.Annotation.function
987
- [ Elm.Annotation.namedWith
988
- [ "Pages", "PageUrl" ]
989
- "PageUrl"
990
- []
991
- , Elm.Annotation.namedWith [ "Shared" ] "Model" []
992
- , Elm.Annotation.namedWith
993
- [ "RouteBuilder" ]
994
- "StaticPayload"
995
- [ Elm.Annotation.var "data"
996
- , Elm.Annotation.var "action"
997
- , Elm.Annotation.var "routeParams"
998
- ]
999
- , Elm.Annotation.var "msg"
1000
- , Elm.Annotation.var "model"
1001
- ]
1002
- (case buildWithLocalStateArg.state of
1003
- LocalState ->
1004
- Elm.Annotation.tuple
1005
- (Elm.Annotation.var "model")
1006
- (Elm.Annotation.namedWith
1007
- [ "Effect" ]
1008
- "Effect"
1009
- [ Elm.Annotation.var "msg" ]
1010
- )
1011
-
1012
- SharedState ->
1013
- Elm.Annotation.triple
1014
- (Elm.Annotation.var "model")
1015
- (Elm.Annotation.namedWith
1016
- [ "Effect" ]
1017
- "Effect"
1018
- [ Elm.Annotation.var "msg" ]
1019
- )
1020
- (Elm.Annotation.maybe (Elm.Annotation.named [ "Shared" ] "Msg"))
1021
- )
1022
- )
1023
- , ( "subscriptions"
1024
- , Elm.Annotation.function
1025
- [ Elm.Annotation.maybe
1026
- (Elm.Annotation.namedWith
1027
- [ "Pages", "PageUrl" ]
1028
- "PageUrl"
1029
- []
1030
- )
1031
- , Elm.Annotation.var "routeParams"
1032
- , Elm.Annotation.namedWith [ "Path" ] "Path" []
1033
- , Elm.Annotation.namedWith [ "Shared" ] "Model" []
1034
- , Elm.Annotation.var "model"
1035
- ]
1036
- (Elm.Annotation.namedWith [] "Sub" [ Elm.Annotation.var "msg" ])
1037
- )
1038
- ]
1039
- , Elm.Annotation.namedWith
1040
- [ "RouteBuilder" ]
1041
- "Builder"
1042
- [ Elm.Annotation.var "routeParams"
1043
- , Elm.Annotation.var "data"
1044
- , Elm.Annotation.var "action"
1045
- ]
1046
- ]
1047
- (Elm.Annotation.namedWith
1048
- [ "RouteBuilder" ]
1049
- "StatefulRoute"
1050
- [ Elm.Annotation.var "routeParams"
1051
- , Elm.Annotation.var "data"
1052
- , Elm.Annotation.var "action"
1053
- , Elm.Annotation.var "model"
1054
- , Elm.Annotation.var "msg"
1055
- ]
1056
- )
1057
- )
1058
- }
1059
- )
1060
- [ Elm.record
1061
- [ Tuple.pair
1062
- "view"
1063
- (Elm.functionReduced
1064
- "buildWithLocalStateUnpack"
1065
- (\functionReducedUnpack ->
1066
- Elm.functionReduced
1067
- "unpack"
1068
- (\functionReducedUnpack0 ->
1069
- Elm.functionReduced
1070
- "unpack"
1071
- (\functionReducedUnpack_2_1_2_0_2_2_0_1_0_2_0_0 ->
1072
- Elm.functionReduced
1073
- "unpack"
1074
- (buildWithLocalStateArg.view
1075
- functionReducedUnpack
1076
- functionReducedUnpack0
1077
- functionReducedUnpack_2_1_2_0_2_2_0_1_0_2_0_0
1078
- )
1079
- )
1080
- )
1081
- )
1082
- )
1083
- , Tuple.pair
1084
- "init"
1085
- (Elm.functionReduced
1086
- "buildWithLocalStateUnpack"
1087
- (\functionReducedUnpack ->
1088
- Elm.functionReduced
1089
- "unpack"
1090
- (\functionReducedUnpack0 ->
1091
- Elm.functionReduced
1092
- "unpack"
1093
- (buildWithLocalStateArg.init
1094
- functionReducedUnpack
1095
- functionReducedUnpack0
1096
- )
1097
- )
1098
- )
1099
- )
1100
- , Tuple.pair
1101
- "update"
1102
- (Elm.functionReduced
1103
- "buildWithLocalStateUnpack"
1104
- (\functionReducedUnpack ->
1105
- Elm.functionReduced
1106
- "unpack"
1107
- (\functionReducedUnpack0 ->
1108
- Elm.functionReduced
1109
- "unpack"
1110
- (\functionReducedUnpack_2_1_2_0_2_2_2_1_0_2_0_0 ->
1111
- Elm.functionReduced
1112
- "unpack"
1113
- (\functionReducedUnpack_2_1_2_1_2_0_2_2_2_1_0_2_0_0 ->
1114
- Elm.functionReduced
1115
- "unpack"
1116
- (buildWithLocalStateArg.update
1117
- functionReducedUnpack
1118
- functionReducedUnpack0
1119
- functionReducedUnpack_2_1_2_0_2_2_2_1_0_2_0_0
1120
- functionReducedUnpack_2_1_2_1_2_0_2_2_2_1_0_2_0_0
1121
- )
1122
- )
1123
- )
1124
- )
1125
- )
1126
- )
1127
- , Tuple.pair
1128
- "subscriptions"
1129
- (Elm.functionReduced
1130
- "buildWithLocalStateUnpack"
1131
- (\functionReducedUnpack ->
1132
- Elm.functionReduced
1133
- "unpack"
1134
- (\functionReducedUnpack0 ->
1135
- Elm.functionReduced
1136
- "unpack"
1137
- (\functionReducedUnpack_2_1_2_0_2_2_3_1_0_2_0_0 ->
1138
- Elm.functionReduced
1139
- "unpack"
1140
- (\functionReducedUnpack_2_1_2_1_2_0_2_2_3_1_0_2_0_0 ->
1141
- Elm.functionReduced
1142
- "unpack"
1143
- (buildWithLocalStateArg.subscriptions
1144
- functionReducedUnpack
1145
- functionReducedUnpack0
1146
- functionReducedUnpack_2_1_2_0_2_2_3_1_0_2_0_0
1147
- functionReducedUnpack_2_1_2_1_2_0_2_2_3_1_0_2_0_0
1148
- )
1149
- )
1150
- )
1151
- )
1152
- )
1153
- )
1154
- ]
1155
- , buildWithLocalStateArg0
1156
- ]
1157
-
1158
-
1159
- buildNoState_ :
1160
- { view :
1161
- Elm.Expression -> Elm.Expression -> Elm.Expression -> Elm.Expression
1162
- }
1163
- -> Elm.Expression
1164
- -> Elm.Expression
1165
- buildNoState_ buildNoStateArg buildNoStateArg0 =
1166
- Elm.apply
1167
- (Elm.value
1168
- { importFrom = [ "RouteBuilder" ]
1169
- , name = "buildNoState"
1170
- , annotation =
1171
- Just
1172
- (Elm.Annotation.function
1173
- [ Elm.Annotation.record
1174
- [ ( "view"
1175
- , Elm.Annotation.function
1176
- [ Elm.Annotation.maybe
1177
- (Elm.Annotation.namedWith
1178
- [ "Pages", "PageUrl" ]
1179
- "PageUrl"
1180
- []
1181
- )
1182
- , Elm.Annotation.namedWith [ "Shared" ] "Model" []
1183
- , Elm.Annotation.namedWith
1184
- [ "RouteBuilder" ]
1185
- "StaticPayload"
1186
- [ Elm.Annotation.var "data"
1187
- , Elm.Annotation.var "action"
1188
- , Elm.Annotation.var "routeParams"
1189
- ]
1190
- ]
1191
- (Elm.Annotation.namedWith
1192
- [ "View" ]
1193
- "View"
1194
- [ Elm.Annotation.namedWith
1195
- [ "Pages", "Msg" ]
1196
- "Msg"
1197
- [ Elm.Annotation.unit ]
1198
- ]
1199
- )
1200
- )
1201
- ]
1202
- , Elm.Annotation.namedWith
1203
- [ "RouteBuilder" ]
1204
- "Builder"
1205
- [ Elm.Annotation.var "routeParams"
1206
- , Elm.Annotation.var "data"
1207
- , Elm.Annotation.var "action"
1208
- ]
1209
- ]
1210
- (Elm.Annotation.namedWith
1211
- [ "RouteBuilder" ]
1212
- "StatefulRoute"
1213
- [ Elm.Annotation.var "routeParams"
1214
- , Elm.Annotation.var "data"
1215
- , Elm.Annotation.var "action"
1216
- , Elm.Annotation.record []
1217
- , Elm.Annotation.unit
1218
- ]
1219
- )
1220
- )
1221
- }
1222
- )
1223
- [ Elm.record
1224
- [ Tuple.pair
1225
- "view"
1226
- (Elm.functionReduced
1227
- "buildNoStateUnpack"
1228
- (\functionReducedUnpack ->
1229
- Elm.functionReduced
1230
- "unpack"
1231
- (\functionReducedUnpack0 ->
1232
- Elm.functionReduced
1233
- "unpack"
1234
- (buildNoStateArg.view functionReducedUnpack
1235
- functionReducedUnpack0
1236
- )
1237
- )
1238
- )
1239
- )
1240
- ]
1241
- , buildNoStateArg0
1242
- ]