Is there a way to use the built-in React cache() function to set a cached value in proxy.ts and then use that value in actual server components now that Next 16 moves Proxies to run in the Node runtime?
On dev I’m setting a value this way but I don’t see it reflected in the server components.
The reason I want to do this is for paraglide JS, an i18n library - right now since passing values via headers or cookies requires accessing them as Promises, and server component renders happen in parallel, even if you set the active locale that the library uses from the header in your root layout, that value will not be made present to other rendered components before they get rendered on the server. So running such code in proxy.ts seems like a good idea since that should run before the actual component renders; and React cache() would be an ideal way to set it per-request without the need for awaiting Promises; but that doesn’t seem to work.
Relevant discussion: AsyncLocalStorage From middleware to server component · vercel/next.js · Discussion #76582 · GitHub