processing / processing/p5.js-web-editor

Discussion: Why is the 404 page rendered by the server?

Open
#2,159 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Discussion Question
Dominant language
JavaScript
Stars
1.7k
Forks
1.7k
Avg merge
3d 4h
Merged PRs (30d)
8

Description

Right now the 404 not found page is generated as string of HTML and CSS and is returned directly by the server, no React involved.

The most obvious downside of this approach is that the text on this page will never get translated to the user's current language, which is a barrier to accessibility.

I'm researching this a bit and realizing that we do need to serve something different from the server in order to get the correct HTTP status code on the page (404 rather than 200). But it seems like the server should return more of a skeleton and let React inject the content. In fact, I think it could still return the same index page? react-router can be set up to display the "page not found" content when there is no matched route.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading server/views/404Page.js and server/views/index.js to understand the current server-rendered responses. Then inspect the React routing entry point and how react-router handles unmatched routes. Done means the server still returns HTTP 404 while the not-found content is rendered by React and can use the user's language.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
full-stack
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.