react/scripts/jest
Sebastian Markbåge ef9f6e77b8
Enable passing Server References from Server to Client (#26124)
This is the first of a series of PRs, that let you pass functions, by
reference, to the client and back. E.g. through Server Context. It's
like client references but they're opaque on the client and resolved on
the server.

To do this, for security, you must opt-in to exposing these functions to
the client using the `"use server"` directive. The `"use client"`
directive lets you enter the client from the server. The `"use server"`
directive lets you enter the server from the client.

This works by tagging those functions as Server References. We could
potentially expand this to other non-serializable or stateful objects
too like classes.

This only implements server->server CJS imports and server->server ESM
imports. We really should add a loader to the webpack plug-in for
client->server imports too. I'll leave closures as an exercise for
integrators.

You can't "call" a client reference on the server, however, you can
"call" a server reference on the client. This invokes a callback on the
Flight client options called `callServer`. This lets a router implement
calling back to the server. Effectively creating an RPC. This is using
JSON for serializing those arguments but more utils coming from
client->server serialization.
2023-02-09 19:45:05 -05:00
..
devtools Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
matchers Update to Jest 29 (#26088) 2023-02-09 17:07:49 +01:00
spec-equivalence-reporter Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
typescript Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
ReactDOMServerIntegrationEnvironment.js Update to Jest 29 (#26088) 2023-02-09 17:07:49 +01:00
TestFlags.js Remove Reconciler fork (1/2) (#25774) 2022-12-01 23:06:25 -05:00
config.base.js Update jest escapeString config (#26140) 2023-02-10 00:08:37 +01:00
config.build-devtools.js [DevTools] Fix moduleNameMapper Order in DevTools Config #24602) 2022-05-23 14:18:17 -07:00
config.build.js Upgrade useSyncExternalStore to alpha channel (#22662) 2021-10-31 15:38:03 -07:00
config.source-persistent.js DevTools: Show hook names based on variable usage (#21641) 2021-07-01 14:39:18 -04:00
config.source-www.js DevTools: Show hook names based on variable usage (#21641) 2021-07-01 14:39:18 -04:00
config.source.js DevTools: Show hook names based on variable usage (#21641) 2021-07-01 14:39:18 -04:00
dont-run-jest-directly.js Add error when running jest directly (#12726) 2018-05-01 12:46:17 -07:00
jest-cli.js fix scripts folder text (#24609) 2022-05-25 09:56:35 -04:00
jest.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
jestSequencer.js Parallelize Jest in CI (#19552) 2020-08-07 16:32:59 -04:00
noHaste.js Forbid Haste in Jest (#11647) 2017-11-23 18:02:47 +00:00
preprocessor.js Update to Jest 29 (#26088) 2023-02-09 17:07:49 +01:00
setupEnvironment.js Update to Jest 29 (#26088) 2023-02-09 17:07:49 +01:00
setupGlobal.js Use toMatchInlineSnapshot for dehydrated values (#20618) 2021-04-26 12:30:34 -04:00
setupHostConfigs.js Enable passing Server References from Server to Client (#26124) 2023-02-09 19:45:05 -05:00
setupTests.build.js Update jest to v26 (#21574) 2021-05-27 16:33:57 +01:00
setupTests.js Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
setupTests.persistent.js Update jest to v26 (#21574) 2021-05-27 16:33:57 +01:00
setupTests.www.js Remove Symbol Polyfill (again) (#25144) 2022-08-25 17:01:30 -04:00
shouldIgnoreConsoleError.js Update to Jest 29 (#26088) 2023-02-09 17:07:49 +01:00