Stop exposing adbkit and crc32 as globals
Summary: Since no plugin directly uses adbkit or crc32 anymore, we removed them from the globals. They wouldn't work in the browser anyway Reviewed By: aigoncharov Differential Revision: D33019084 fbshipit-source-id: 66ab0756399fdb401c63f5e8271bdd62cb79ab4a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ac9080abac
commit
9e09c0d5f7
@@ -17,14 +17,12 @@ const pattern = /^\*\r?\n[\S\s]*Facebook[\S\s]* \* @format\r?\n/;
|
|||||||
|
|
||||||
// This list should match the replacements defined in `replace-flipper-requires.ts` and `dispatcher/plugins.tsx`
|
// This list should match the replacements defined in `replace-flipper-requires.ts` and `dispatcher/plugins.tsx`
|
||||||
const builtInModules = [
|
const builtInModules = [
|
||||||
'fb-qpl-xplat',
|
|
||||||
'flipper',
|
'flipper',
|
||||||
'flipper-plugin',
|
'flipper-plugin',
|
||||||
'flipper-plugin-lib',
|
'flipper-plugin-lib',
|
||||||
'react',
|
'react',
|
||||||
'react-dom',
|
'react-dom',
|
||||||
'electron',
|
'electron',
|
||||||
'adbkit',
|
|
||||||
'antd',
|
'antd',
|
||||||
'immer',
|
'immer',
|
||||||
'@emotion/styled',
|
'@emotion/styled',
|
||||||
|
|||||||
@@ -21,12 +21,10 @@ const requireReplacements: any = {
|
|||||||
'flipper-plugin': 'global.FlipperPlugin',
|
'flipper-plugin': 'global.FlipperPlugin',
|
||||||
react: 'global.React',
|
react: 'global.React',
|
||||||
'react-dom': 'global.ReactDOM',
|
'react-dom': 'global.ReactDOM',
|
||||||
adbkit: 'global.adbkit',
|
|
||||||
antd: 'global.antd',
|
antd: 'global.antd',
|
||||||
immer: 'global.Immer',
|
immer: 'global.Immer',
|
||||||
'@emotion/styled': 'global.emotion_styled',
|
'@emotion/styled': 'global.emotion_styled',
|
||||||
'@ant-design/icons': 'global.antdesign_icons',
|
'@ant-design/icons': 'global.antdesign_icons',
|
||||||
crc32: 'global.crc32_hack_fix_me',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export function tryReplaceFlipperRequire(path: NodePath<CallExpression>) {
|
export function tryReplaceFlipperRequire(path: NodePath<CallExpression>) {
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
"@tanishiking/aho-corasick": "^0.0.1",
|
"@tanishiking/aho-corasick": "^0.0.1",
|
||||||
"@types/archiver": "^5.1.1",
|
"@types/archiver": "^5.1.1",
|
||||||
"@types/uuid": "^8.3.1",
|
"@types/uuid": "^8.3.1",
|
||||||
"adbkit": "^2.11.1",
|
|
||||||
"antd": "4.16.8",
|
"antd": "4.16.8",
|
||||||
"archiver": "^5.0.2",
|
"archiver": "^5.0.2",
|
||||||
"async-mutex": "^0.3.2",
|
"async-mutex": "^0.3.2",
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import {
|
|||||||
import {PluginDefinition} from '../plugin';
|
import {PluginDefinition} from '../plugin';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import adbkit from 'adbkit';
|
|
||||||
import {
|
import {
|
||||||
registerPlugins,
|
registerPlugins,
|
||||||
addGatekeepedPlugins,
|
addGatekeepedPlugins,
|
||||||
@@ -42,8 +41,6 @@ import * as Immer from 'immer';
|
|||||||
import * as antd from 'antd';
|
import * as antd from 'antd';
|
||||||
import * as emotion_styled from '@emotion/styled';
|
import * as emotion_styled from '@emotion/styled';
|
||||||
import * as antdesign_icons from '@ant-design/icons';
|
import * as antdesign_icons from '@ant-design/icons';
|
||||||
// @ts-ignore
|
|
||||||
import * as crc32 from 'crc32';
|
|
||||||
|
|
||||||
import {isDevicePluginDefinition} from '../utils/pluginUtils';
|
import {isDevicePluginDefinition} from '../utils/pluginUtils';
|
||||||
import isPluginCompatible from '../utils/isPluginCompatible';
|
import isPluginCompatible from '../utils/isPluginCompatible';
|
||||||
@@ -62,13 +59,11 @@ export default async (store: Store, _logger: Logger) => {
|
|||||||
globalObject.React = React;
|
globalObject.React = React;
|
||||||
globalObject.ReactDOM = ReactDOM;
|
globalObject.ReactDOM = ReactDOM;
|
||||||
globalObject.Flipper = require('../deprecated-exports');
|
globalObject.Flipper = require('../deprecated-exports');
|
||||||
globalObject.adbkit = adbkit;
|
|
||||||
globalObject.FlipperPlugin = FlipperPluginSDK;
|
globalObject.FlipperPlugin = FlipperPluginSDK;
|
||||||
globalObject.Immer = Immer;
|
globalObject.Immer = Immer;
|
||||||
globalObject.antd = antd;
|
globalObject.antd = antd;
|
||||||
globalObject.emotion_styled = emotion_styled;
|
globalObject.emotion_styled = emotion_styled;
|
||||||
globalObject.antdesign_icons = antdesign_icons;
|
globalObject.antdesign_icons = antdesign_icons;
|
||||||
globalObject.crc32_hack_fix_me = crc32;
|
|
||||||
|
|
||||||
const gatekeepedPlugins: Array<ActivatablePluginDetails> = [];
|
const gatekeepedPlugins: Array<ActivatablePluginDetails> = [];
|
||||||
const disabledPlugins: Array<ActivatablePluginDetails> = [];
|
const disabledPlugins: Array<ActivatablePluginDetails> = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user