Setup globals and initialize flipper-server-companion

Summary:
We want Flipper plugins to share imports with Flipper:
- They must share the same React otherwise different Reacts could conflict with each other
- Other common modules are shared to decrease the bundle size for each plugin.

`setGlobalObject` provides shared modules to Flipper Plugins by adding them to the global context (window or process or global this).

In the headless context, we do not have React and other DOM-related libraries, so we provide stubs instead.

Reviewed By: passy

Differential Revision: D36130161

fbshipit-source-id: d30c59a6c3ae02e7f9244bc0bb5790079b771107
This commit is contained in:
Andrey Goncharov
2022-05-10 05:13:24 -07:00
committed by Facebook GitHub Bot
parent c1dc1788a5
commit 1f2f799772
6 changed files with 112 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
export const unstable_batchedUpdates = (cb: () => void) => {
return cb();
};