-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Docs: "server-only" package is referenced, but not documented #71071
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
Comments
@petetnt Thank you for submitting an issue! We will take a look at this soon to see how we can document this better |
bumping this |
Bumping this again |
Bumping this. I must say, without documentation and seeing "Last Updated 3 years ago" makes it even harder to tell if it's official, if it does what it should do (whatever it is if you just stumbled upon it). |
I don't know about official or not, but t A74F he package is more or less 1 line of code, so it does not really need any further updates. I agree that documentation is severely lacking. |
Yes, I didn't mean it as in it's outdated but from someone new to Next this could easily be interpreted as such without documentation about the package. |
Bumping this again |
Uh oh!
There was an error while loading. Please reload this page.
What is the documentation issue?
Package
server-only
has no documentation and it's hard to say if it's a official package, or unofficial one, or recommended one. It's also very hard to say where it's sourced from without extensive detective work. It's being used both in NextJS docs as well asreact.dev
documentation.The package should be documented, most likely owned one of the orgs and the source should be clearly available.
Is there any context that might help us understand?
This issue is about general confusion about
server-only
package.Everything probably starts somewhere around https://github.com/reactjs/rfcs/blob/main/text/0227-server-module-conventions.md where Ryo and Dan have a propsal around server-module-conventions. It describes poisoning imports using a package.
At the same time, https://www.npmjs.com/package/server-only/v/0.0.1 is published to
npm
by @sebmarkbage , that contains absolutely no documentation and points toreactjs.org
, making it seem that it's somehow related to React itself, despite not living under any Meta related namespace.There's two usages of the package documented very loosely on the internet, first one can be found in the NextJS docs that clearly says that "install this package, use it like this", and it's probably fine: https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#keeping-server-only-code-out-of-the-client-environment
Closest thing to the source code is probably this pull request in NextJS #44861 that brings those imports to the NextJS codebase, the actual source code of
server-only
seems to match that, despite different author and being released a year before the package. Maybe I am missing something here?Finally in the
react.dev
docs itself,server-only
is used as a concept, but also as an actual package in https://react.dev/reference/react/experimental_taintUniqueValue#using-server-only-and-taintuniquevalue-to-prevent-leaking-secretsDoes the docs page already exist? Please link to it.
https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#keeping-server-only-code-out-of-the-client-environment
The text was updated successfully, but these errors were encountered: