Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/shiny-owls-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-router": patch
---

Remove dependency on `@types/node` in TypeScript declaration files
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@
- mcansh
- MeatSim
- MenouerBetty
- Methuselah96
- mfijas
- MichaelDeBoey
- michal-antczak
Expand Down
10 changes: 3 additions & 7 deletions packages/react-router/lib/rsc/server.rsc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,9 @@ type ServerContext = {
redirect?: Response;
};

declare global {
var ___reactRouterServerStorage___:
| AsyncLocalStorage<ServerContext>
| undefined;
}

const globalVar = typeof globalThis !== "undefined" ? globalThis : global;
const globalVar = (typeof globalThis !== "undefined" ? globalThis : global) as {
___reactRouterServerStorage___?: AsyncLocalStorage<ServerContext>;
};

const ServerStorage = (globalVar.___reactRouterServerStorage___ ??=
new AsyncLocalStorage<ServerContext>());
Expand Down