elm-pages 3.0.0-beta.22 → 3.0.0-beta.23
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/README.md
CHANGED
|
@@ -81,7 +81,7 @@ https://github.com/dillonkearns/elm-pages/projects
|
|
|
81
81
|
You will see an error if the NPM and Elm package do not have a matching Compatibility Key. Usually it's best to upgrade to the latest version of both the Elm and NPM
|
|
82
82
|
packages when you upgrade. However, in case you want to install versions that are behind the latest, the Compatibility Key is included here for reference.
|
|
83
83
|
|
|
84
|
-
Current Compatibility Key:
|
|
84
|
+
Current Compatibility Key: 8.
|
|
85
85
|
|
|
86
86
|
## Contributors ✨
|
|
87
87
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const compatibilityKey =
|
|
1
|
+
export const compatibilityKey = 8;
|
|
2
2
|
|
|
3
|
-
export const packageVersion = "3.0.0-beta.
|
|
3
|
+
export const packageVersion = "3.0.0-beta.23";
|
|
@@ -82,8 +82,7 @@ async function handleEvent(sendContentJsonPort, evt) {
|
|
|
82
82
|
|
|
83
83
|
try {
|
|
84
84
|
await fetchContentJson;
|
|
85
|
-
|
|
86
|
-
thenApplyHmr(elmJsResponse);
|
|
85
|
+
thenApplyHmr(await elmJsRequest);
|
|
87
86
|
} catch (errorJson) {
|
|
88
87
|
if (typeof errorJson === "string") {
|
|
89
88
|
errorJson = JSON.parse(errorJson);
|
|
@@ -170,8 +169,7 @@ var myDisposeCallback = function () {
|
|
|
170
169
|
var module = {
|
|
171
170
|
hot: {
|
|
172
171
|
accept: async function () {
|
|
173
|
-
|
|
174
|
-
sendInUpdatedContentJson();
|
|
172
|
+
(await updateAppContentJson)();
|
|
175
173
|
},
|
|
176
174
|
|
|
177
175
|
dispose: function (callback) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "elm-pages",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.23",
|
|
5
5
|
"homepage": "https://elm-pages.com",
|
|
6
6
|
"moduleResolution": "node",
|
|
7
7
|
"description": "Type-safe static sites, written in pure elm with your own custom elm-markup syntax.",
|
|
@@ -269,7 +269,7 @@ init config flags url key =
|
|
|
269
269
|
, url = url
|
|
270
270
|
, currentPath = url.path
|
|
271
271
|
, pageData = Err "Not found"
|
|
272
|
-
, ariaNavigationAnnouncement = "
|
|
272
|
+
, ariaNavigationAnnouncement = "Page Not Found" -- TODO use error page title for announcement?
|
|
273
273
|
, userFlags = flags
|
|
274
274
|
, notFound = Just info
|
|
275
275
|
, transition = Nothing
|
|
@@ -764,7 +764,86 @@ update config appMsg model =
|
|
|
764
764
|
_ ->
|
|
765
765
|
( model, NoEffect )
|
|
766
766
|
)
|
|
767
|
-
|> Result.withDefault
|
|
767
|
+
|> Result.withDefault
|
|
768
|
+
(let
|
|
769
|
+
pageDataResult : Maybe (InitKind sharedData pageData actionData errorPage)
|
|
770
|
+
pageDataResult =
|
|
771
|
+
case Bytes.Decode.decode config.decodeResponse pageDataBytes of
|
|
772
|
+
Just (ResponseSketch.RenderPage _ _) ->
|
|
773
|
+
Nothing
|
|
774
|
+
|
|
775
|
+
Just (ResponseSketch.HotUpdate pageData shared actionData) ->
|
|
776
|
+
OkPage shared pageData actionData
|
|
777
|
+
|> Just
|
|
778
|
+
|
|
779
|
+
Just (ResponseSketch.NotFound notFound) ->
|
|
780
|
+
NotFound notFound
|
|
781
|
+
|> Just
|
|
782
|
+
|
|
783
|
+
_ ->
|
|
784
|
+
Nothing
|
|
785
|
+
in
|
|
786
|
+
case pageDataResult of
|
|
787
|
+
Just (OkPage sharedData pageData actionData) ->
|
|
788
|
+
let
|
|
789
|
+
urls : { currentUrl : Url, basePath : List String }
|
|
790
|
+
urls =
|
|
791
|
+
{ currentUrl = model.url
|
|
792
|
+
, basePath = config.basePath
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
pagePath : Path
|
|
796
|
+
pagePath =
|
|
797
|
+
urlsToPagePath urls
|
|
798
|
+
|
|
799
|
+
userFlags : Pages.Flags.Flags
|
|
800
|
+
userFlags =
|
|
801
|
+
model.userFlags
|
|
802
|
+
|> Decode.decodeValue
|
|
803
|
+
(Decode.field "userFlags" Decode.value)
|
|
804
|
+
|> Result.withDefault Json.Encode.null
|
|
805
|
+
|> Pages.Flags.BrowserFlags
|
|
806
|
+
|
|
807
|
+
( userModel, userCmd ) =
|
|
808
|
+
Just
|
|
809
|
+
{ path =
|
|
810
|
+
{ path = pagePath
|
|
811
|
+
, query = model.url.query
|
|
812
|
+
, fragment = model.url.fragment
|
|
813
|
+
}
|
|
814
|
+
, metadata = config.urlToRoute model.url
|
|
815
|
+
, pageUrl =
|
|
816
|
+
Just
|
|
817
|
+
{ protocol = model.url.protocol
|
|
818
|
+
, host = model.url.host
|
|
819
|
+
, port_ = model.url.port_
|
|
820
|
+
, path = pagePath
|
|
821
|
+
, query = model.url.query |> Maybe.map QueryParams.fromString
|
|
822
|
+
, fragment = model.url.fragment
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
|> config.init userFlags sharedData pageData actionData
|
|
826
|
+
|
|
827
|
+
cmd : Effect userMsg pageData actionData sharedData userEffect errorPage
|
|
828
|
+
cmd =
|
|
829
|
+
UserCmd userCmd
|
|
830
|
+
in
|
|
831
|
+
( { model
|
|
832
|
+
| pageData =
|
|
833
|
+
Ok
|
|
834
|
+
{ userModel = userModel
|
|
835
|
+
, sharedData = sharedData
|
|
836
|
+
, pageData = pageData
|
|
837
|
+
, actionData = actionData
|
|
838
|
+
}
|
|
839
|
+
, notFound = Nothing
|
|
840
|
+
}
|
|
841
|
+
, cmd
|
|
842
|
+
)
|
|
843
|
+
|
|
844
|
+
_ ->
|
|
845
|
+
( model, NoEffect )
|
|
846
|
+
)
|
|
768
847
|
|
|
769
848
|
FetcherStarted fetcherKey transitionId fetcherData initiatedAt ->
|
|
770
849
|
( { model
|