react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

[Beta] Migrating Error Decoder

Open SukkaW opened this issue 2 years ago • 3 comments

beta.reactjs.org currently missing /error-decoder (E.g. https://reactjs.org/docs/error-decoder.html/?invariant=421). https://beta.reactjs.org/docs/error-decoder.html/?invariant=421 will be redirected to ~~https://legacy.reactjs.org/error-decoder.html?invariant=421 which becomes 404.~~ https://legacy.reactjs.org/docs/error-decoder.html?invariant=421

SukkaW avatar Feb 09 '23 13:02 SukkaW

Why does /docs/something redirect to /something? I can't find this redirect.

gaearon avatar Feb 09 '23 14:02 gaearon

Wait, https://beta.reactjs.org/docs/error-decoder.html/?invariant=421 redirects to https://legacy.reactjs.org/docs/error-decoder.html/?invariant=421 for me, which is correct.

gaearon avatar Feb 09 '23 14:02 gaearon

Wait, https://beta.reactjs.org/docs/error-decoder.html/?invariant=421 redirects to https://legacy.reactjs.org/docs/error-decoder.html/?invariant=421 for me, which is correct.

It is working for me now, too. I don't know what happened on my side before, most likely I mistyped something in my browser's address bar.

But the issue is about migrating the existing Error Decoder to Beta Docs.

The current error decoder page has the following parts:

  • The markdown page: https://github.com/reactjs/reactjs.org/blob/d696cb1d2a1ea1d7eb92d5b098b51dde8fcc536c/content/docs/error-decoder.md?plain=1#L1-L5
  • The template of the page: https://github.com/reactjs/reactjs.org/blob/d696cb1d2a1ea1d7eb92d5b098b51dde8fcc536c/src/pages/docs/error-decoder.html.js#L1-L10
  • A Gatsby plugin used to query error code json: https://github.com/reactjs/reactjs.org/blob/d696cb1d2a1ea1d7eb92d5b098b51dde8fcc536c/plugins/gatsby-source-react-error-codes/gatsby-node.js#L13-L30

SukkaW avatar Feb 09 '23 16:02 SukkaW

Yeah, porting the error decoder to the new site would be dope.

rickhanlonii avatar Aug 11 '23 03:08 rickhanlonii

Yeah, porting the error decoder to the new site would be dope.

@rickhanlonii I have just created an initial prototype in #6214.

SukkaW avatar Aug 11 '23 14:08 SukkaW