Helpful dev server 404 page feedback #191
dillonkearns
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
Making good progress! With pre-rendered routesWith no pre-rendered routesHere's a video demo: |
Beta Was this translation helpful? Give feedback.
2 replies
-
Dillon, The developer messages are great - they were very helpful when I was wiring up my pages to debug the Globbing construction. A potential architecture:
If the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm thinking about some ways that the 404 not found page in the dev server could give feedback to make it more clear why the page isn't found to make it easier to debug why your route isn't working, or ease the learning curve for newcomers. If the page simply says "Page not found" without a reason why, that it leaves users wondering whether the dev server picked up their changes, or confused about what step to take to see the route they're looking at.
So this could be a great opportunity to give great feedback like Elm is known for!
Some scenarios
Here are some ideas about different scenarios and possible 404 page messages. Let's say we have these Page Modules:
src/
Page/
Index.elm
About.elm
Blog.elm
Blog/
Slug_.elm
Project/
Name_.elm
Scenario 1 - No Matching Route
/author/jane
404 page message:
Scenario 2 - Matched Route, Zero Pages for Route
/blog/new-post
- Matches RouteBlog.Slug_
, butroutes = DataSource.succeed []
(empty) - Similar toelm-test
"Let's add some!" message.Scenario 3 - Matched Route, At Least One Page for Route
/blog/post2
- Matches RouteBlog.Slug_
, butroutes = DataSource.succeed [ { slug = "post1" } ]
Scenario 4 - Matched Pre-Render with Fallback Route, Not Handled
/project/some-project
Scenario 5 - Matched Server-Rendered Route, Not Handled
/project/some-project
I matched a Route, but
handleRoute
wasFalse
for theRouteParams
argument{ name = "some-project" }
.Try changing
src/Page/Project/Name_.elm
to handle these RouteParams inhandleRoute
.Feedback
I'd love to hear thoughts! It would be great to make
elm-pages
stand out for extremely helpful feedback all around.Beta Was this translation helpful? Give feedback.
All reactions