-
Notifications
You must be signed in to change notification settings - Fork 973
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
Add per request global context #1789
Conversation
Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
| AsyncLocalStorage<Map<string, GlobalContext>> = undefined | ||
|
||
export const usePerRequestContext = () => | ||
process.env.SAFE_GLOBAL_CONTEXT !== '1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we set this to '1'
in the netlify and vercel deploy setup scripts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - because there is a performance impact, but I'm not 100% certain that I want to trust Netlify and Vercel. So I would like to make this the default everywhere, and give people the ability to opt-out with the understand that it could be a problem.
@peterp @Tobbe we definitely need some documentation about all this. Maybe we expand this doc to be API & Serverless Functions... https://redwoodjs.com/docs/serverless-functions |
This adds the experimental NodsJS async local storage API so that we can have a per-request global context.