Improve Error Messages when Access Client References (#26059)
This renames Module References to Client References, since they are in the server->client direction. I also changed the Proxies exposed from the `node-register` loader to provide better error messages. Ideally, some of this should be replicated in the ESM loader too but neither are the source of truth. We'll replicate this in the static form in the Next.js loaders. cc @huozhi @shuding - All references are now functions so that when you call them on the server, we can yield a better error message. - References that are themselves already referring to an export name are now proxies that error when you dot into them. - `use(...)` can now be used on a client reference to unwrap it server side and then pass a reference to the awaited value.
S
Sebastian Markbåge committed
ce09ace9a23b61dfba53f5a83d52b377bc642bae
Parent: 78c4bec
Committed by GitHub <noreply@github.com>
on 1/28/2023, 1:08:26 AM