elm-pages 3.0.0-beta.4 → 3.0.0-beta.41

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 (148) hide show
  1. package/README.md +10 -1
  2. package/adapter/netlify.js +207 -0
  3. package/codegen/{elm-pages-codegen.js → elm-pages-codegen.cjs} +2828 -2933
  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 +1447 -342
  12. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/Runner.elm.js +17004 -13817
  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 +1447 -342
  27. package/generator/review/elm-stuff/tests-0.19.1/js/Runner.elm.js +25025 -21739
  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 +121 -114
  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 +209 -92
  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 +39 -0
  41. package/generator/src/copy-dir.js +2 -2
  42. package/generator/src/dev-server.js +176 -138
  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 +39 -28
  51. package/generator/src/render-test.js +109 -0
  52. package/generator/src/render-worker.js +25 -28
  53. package/generator/src/render.js +321 -142
  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 +12 -7
  61. package/generator/src/vite-utils.js +77 -0
  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 +6 -5
  65. package/generator/template/app/Effect.elm +123 -0
  66. package/generator/template/app/ErrorPage.elm +37 -6
  67. package/generator/template/app/Route/Index.elm +17 -10
  68. package/generator/template/app/Shared.elm +24 -47
  69. package/generator/template/app/Site.elm +19 -6
  70. package/generator/template/app/View.elm +1 -8
  71. package/generator/template/elm-tooling.json +0 -3
  72. package/generator/template/elm.json +32 -24
  73. package/generator/template/package.json +10 -4
  74. package/package.json +30 -27
  75. package/src/ApiRoute.elm +199 -61
  76. package/src/BackendTask/Custom.elm +325 -0
  77. package/src/BackendTask/Env.elm +90 -0
  78. package/src/{DataSource → BackendTask}/File.elm +171 -56
  79. package/src/{DataSource → BackendTask}/Glob.elm +136 -125
  80. package/src/BackendTask/Http.elm +679 -0
  81. package/src/{DataSource → BackendTask}/Internal/Glob.elm +1 -1
  82. package/src/BackendTask/Internal/Request.elm +69 -0
  83. package/src/BackendTask/Random.elm +79 -0
  84. package/src/BackendTask/Time.elm +47 -0
  85. package/src/BackendTask.elm +531 -0
  86. package/src/FatalError.elm +90 -0
  87. package/src/Head/Seo.elm +4 -4
  88. package/src/Head.elm +237 -7
  89. package/src/HtmlPrinter.elm +7 -3
  90. package/src/Internal/ApiRoute.elm +7 -5
  91. package/src/PageServerResponse.elm +6 -1
  92. package/src/Pages/ConcurrentSubmission.elm +127 -0
  93. package/src/Pages/Form.elm +340 -0
  94. package/src/Pages/FormData.elm +18 -0
  95. package/src/Pages/GeneratorProgramConfig.elm +15 -0
  96. package/src/Pages/Internal/FatalError.elm +5 -0
  97. package/src/Pages/Internal/Msg.elm +93 -0
  98. package/src/Pages/Internal/NotFoundReason.elm +4 -4
  99. package/src/Pages/Internal/Platform/Cli.elm +617 -768
  100. package/src/Pages/Internal/Platform/CompatibilityKey.elm +6 -0
  101. package/src/Pages/Internal/Platform/Effect.elm +1 -2
  102. package/src/Pages/Internal/Platform/GeneratorApplication.elm +379 -0
  103. package/src/Pages/Internal/Platform/StaticResponses.elm +65 -276
  104. package/src/Pages/Internal/Platform/ToJsPayload.elm +6 -9
  105. package/src/Pages/Internal/Platform.elm +359 -225
  106. package/src/Pages/Internal/ResponseSketch.elm +2 -2
  107. package/src/Pages/Internal/Script.elm +17 -0
  108. package/src/Pages/Internal/StaticHttpBody.elm +35 -1
  109. package/src/Pages/Manifest.elm +52 -11
  110. package/src/Pages/Navigation.elm +87 -0
  111. package/src/Pages/PageUrl.elm +26 -12
  112. package/src/Pages/ProgramConfig.elm +35 -23
  113. package/src/Pages/Script.elm +166 -0
  114. package/src/Pages/SiteConfig.elm +3 -2
  115. package/src/Pages/StaticHttp/Request.elm +2 -2
  116. package/src/Pages/StaticHttpRequest.elm +23 -99
  117. package/src/Pages/Url.elm +3 -3
  118. package/src/PagesMsg.elm +88 -0
  119. package/src/QueryParams.elm +21 -172
  120. package/src/RenderRequest.elm +7 -7
  121. package/src/RequestsAndPending.elm +37 -20
  122. package/src/Result/Extra.elm +26 -0
  123. package/src/Scaffold/Form.elm +569 -0
  124. package/src/Scaffold/Route.elm +1411 -0
  125. package/src/Server/Request.elm +74 -72
  126. package/src/Server/Session.elm +62 -42
  127. package/src/Server/SetCookie.elm +80 -32
  128. package/src/Stub.elm +53 -0
  129. package/src/Test/Html/Internal/ElmHtml/ToString.elm +8 -9
  130. package/src/{Path.elm → UrlPath.elm} +33 -36
  131. package/src/DataSource/Env.elm +0 -38
  132. package/src/DataSource/Http.elm +0 -446
  133. package/src/DataSource/Internal/Request.elm +0 -20
  134. package/src/DataSource/Port.elm +0 -90
  135. package/src/DataSource.elm +0 -538
  136. package/src/Form/Field.elm +0 -717
  137. package/src/Form/FieldStatus.elm +0 -36
  138. package/src/Form/FieldView.elm +0 -417
  139. package/src/Form/FormData.elm +0 -22
  140. package/src/Form/Validation.elm +0 -391
  141. package/src/Form/Value.elm +0 -118
  142. package/src/Form.elm +0 -1683
  143. package/src/FormDecoder.elm +0 -102
  144. package/src/Pages/FormState.elm +0 -256
  145. package/src/Pages/Generate.elm +0 -800
  146. package/src/Pages/Internal/Form.elm +0 -17
  147. package/src/Pages/Msg.elm +0 -79
  148. package/src/Pages/Transition.elm +0 -70
@@ -1,800 +0,0 @@
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
- ]