Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: use custom status codes in SSR & DSG response #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
chrisq21 wants to merge 2 commits into netlify:main
base: main
Choose a base branch
Loading
from chrisq21:main

Conversation

Copy link

@chrisq21 chrisq21 commented Apr 22, 2022

The DSG & SSR handler uses the serverDataStatus value to use custom status codes. Defaults to 200

🎉 Thanks for sending this pull request! 🎉

Please make sure the title is clear and descriptive.

If you are fixing a typo or documentation, please skip these instructions.

Otherwise please fill in the sections below.

Which problem is this pull request solving?

Example: I'm always frustrated when [...]

List other issues or pull requests related to this problem

Example: This fixes #5012

Describe the solution you've chosen

Example: I've fixed this by [...]

Describe alternatives you've considered

Example: Another solution would be [...]

Checklist

Please add a x inside each checkbox:

  • I have read the contribution guidelines.
  • I have added tests (we are enforcing 100% test coverage).
  • I have added documentation in the README.md, the docs directory (if
    any) and the examples directory (if any).
  • The status checks are successful (continuous integration). Those can be
    seen below.

The DSG & SSR handler uses the `serverDataStatus` value to use custom status codes. Defaults to 200
Copy link

netlify bot commented Apr 22, 2022
edited
Loading

👷 Deploy request for netlify-plugin-gatsby-demo pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 9f57e4e

Copy link
Contributor

ascorbic commented Apr 25, 2022
edited
Loading

Thanks for this! Looking good so far. The issue seems to be with the types for getData. Would this be fixed by updating the version of Gatsby in the demo site, or are the types missing from Gatsby?

Copy link
Author

Happy to contribute!

Yeah the ISSRData type defined here contains serverDataStatus, but ISSRData in the type declaration file doesn't expose serverDataStatus.

@ascorbic Would you recommend creating a PR in the gatsby repo to include serverDataStatus in the type declaration file as a pre-requisite for this PR, or some other approach? I noticed that the gatsby-plugin-fastify plugin was able to reference serverDataStatus in this update so wasn't sure if I was missing something.

Copy link
Contributor

I would do a PR to Gatsby (apart from anything, they'll send you some great swag if you do!). However if you don't want to wait, we did previously define our own types while we waited for them to update the published types, so you might want to do similar here.

Copy link
Author

Sounds good! This can wait a bit so I'll go ahead and make a PR into the Gatsby repo.

Copy link
Contributor

Great! I recommend the jamstack jammies 😄

chrisq21 reacted with laugh emoji

Copy link

any updates on this? this feature is essential to work with gatsby ssr on netlify. without we cannot send a 404 statuscode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /