mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Remove deprecated APIs and modules
Summary: We've deprecated these APIs for quite a few releases and we should be able to get rid of them now. Remove following deprecated modules/components - AppStateIOS - ActivityIndicatorIOS - IntentAndroid - SliderIOS - SwitchAndroid - SwitchIOS - LinkingIOS Update following modules to remove callback support - Clipboard - NetInfo cc bestander Closes https://github.com/facebook/react-native/pull/9891 Reviewed By: bestander Differential Revision: D3974094 Pulled By: javache fbshipit-source-id: 9abe32716bd85d0cea9933894f4447d53bdd5ee7
This commit is contained in:
committed by
Facebook Github Bot
parent
9ed9bca0bf
commit
fa5ad85252
@@ -9,7 +9,6 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const babel = require('babel-core');
|
||||
const deepAssign = require('deep-assign');
|
||||
const docgen = require('react-docgen');
|
||||
@@ -41,7 +40,7 @@ function getNameFromPath(filepath) {
|
||||
filepath = removeExtName(filepath);
|
||||
if (filepath === 'LayoutPropTypes') {
|
||||
return 'Layout Props';
|
||||
} else if (filepath == 'ShadowPropTypesIOS') {
|
||||
} else if (filepath === 'ShadowPropTypesIOS') {
|
||||
return 'Shadow Props';
|
||||
} else if (filepath === 'TransformPropTypes') {
|
||||
return 'Transforms';
|
||||
@@ -65,7 +64,7 @@ function getPlatformFromPath(filepath) {
|
||||
|
||||
function getExamplePaths(componentName, componentPlatform) {
|
||||
const componentExample = '../Examples/UIExplorer/js/' + componentName + 'Example.';
|
||||
let pathsToCheck = [
|
||||
const pathsToCheck = [
|
||||
componentExample + 'js',
|
||||
componentExample + componentPlatform + '.js',
|
||||
];
|
||||
@@ -75,7 +74,7 @@ function getExamplePaths(componentName, componentPlatform) {
|
||||
componentExample + ANDROID_SUFFIX + '.js'
|
||||
);
|
||||
}
|
||||
let paths = [];
|
||||
const paths = [];
|
||||
pathsToCheck.map((p) => {
|
||||
if (fs.existsSync(p)) {
|
||||
paths.push(p);
|
||||
@@ -87,7 +86,7 @@ function getExamplePaths(componentName, componentPlatform) {
|
||||
function getExamples(componentName, componentPlatform) {
|
||||
const paths = getExamplePaths(componentName, componentPlatform);
|
||||
if (paths) {
|
||||
let examples = [];
|
||||
const examples = [];
|
||||
paths.map((p) => {
|
||||
const platform = p.match(/Example\.(.*)\.js$/);
|
||||
let title = '';
|
||||
@@ -243,7 +242,7 @@ function getTypedef(filepath, fileContent, json) {
|
||||
if (!json) {
|
||||
return typedefDocgen;
|
||||
}
|
||||
let typedef = typedefDocgen;
|
||||
const typedef = typedefDocgen;
|
||||
if (json.typedef && json.typedef.length !== 0) {
|
||||
json.typedef.forEach(def => {
|
||||
const typedefMatch = typedefDocgen.find(t => t.name === def.name);
|
||||
@@ -316,7 +315,7 @@ function parseAPIJsDocFormat(filepath, fileContent) {
|
||||
identifier.order = index;
|
||||
});
|
||||
// Group by "kind"
|
||||
let json = {};
|
||||
const json = {};
|
||||
jsonParsed.forEach((identifier, index) => {
|
||||
let kind = identifier.kind;
|
||||
if (kind === 'function') {
|
||||
@@ -409,7 +408,7 @@ function getTypehint(typehint) {
|
||||
}
|
||||
|
||||
function getJsDocFormatType(entities) {
|
||||
let modEntities = entities;
|
||||
const modEntities = entities;
|
||||
if (entities) {
|
||||
if (typeof entities === 'object' && entities.length) {
|
||||
entities.map((entity, entityIndex) => {
|
||||
@@ -440,11 +439,11 @@ function renderAPI(filepath, type) {
|
||||
const fileContent = fs.readFileSync(filepath).toString();
|
||||
let json = parseAPIInferred(filepath, fileContent);
|
||||
if (isJsDocFormat(fileContent)) {
|
||||
let jsonJsDoc = parseAPIJsDocFormat(filepath, fileContent);
|
||||
const jsonJsDoc = parseAPIJsDocFormat(filepath, fileContent);
|
||||
// Combine method info with jsdoc formatted content
|
||||
const methods = json.methods;
|
||||
if (methods && methods.length) {
|
||||
let modMethods = methods;
|
||||
const modMethods = methods;
|
||||
methods.map((method, methodIndex) => {
|
||||
modMethods[methodIndex].params = getJsDocFormatType(method.params);
|
||||
modMethods[methodIndex].returns =
|
||||
@@ -486,7 +485,6 @@ function renderStyle(filepath) {
|
||||
|
||||
const components = [
|
||||
'../Libraries/Components/ActivityIndicator/ActivityIndicator.js',
|
||||
'../Libraries/Components/ActivityIndicator/ActivityIndicatorIOS.ios.js',
|
||||
'../Libraries/Components/Button.js',
|
||||
'../Libraries/Components/DatePicker/DatePickerIOS.ios.js',
|
||||
'../Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js',
|
||||
@@ -505,12 +503,9 @@ const components = [
|
||||
'../Libraries/Components/ScrollView/ScrollView.js',
|
||||
'../Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js',
|
||||
'../Libraries/Components/Slider/Slider.js',
|
||||
'../Libraries/Components/SliderIOS/SliderIOS.ios.js',
|
||||
'../Libraries/Components/StatusBar/StatusBar.js',
|
||||
'../Libraries/RCTTest/SnapshotViewIOS.ios.js',
|
||||
'../Libraries/Components/Switch/Switch.js',
|
||||
'../Libraries/Components/SwitchAndroid/SwitchAndroid.android.js',
|
||||
'../Libraries/Components/SwitchIOS/SwitchIOS.ios.js',
|
||||
'../Libraries/Components/TabBarIOS/TabBarIOS.ios.js',
|
||||
'../Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js',
|
||||
'../Libraries/Text/Text.js',
|
||||
@@ -544,7 +539,6 @@ const apis = [
|
||||
'../Libraries/Image/ImageEditor.js',
|
||||
'../Libraries/CameraRoll/ImagePickerIOS.js',
|
||||
'../Libraries/Image/ImageStore.js',
|
||||
'../Libraries/Components/Intent/IntentAndroid.android.js',
|
||||
'../Libraries/Interaction/InteractionManager.js',
|
||||
'../Libraries/Components/Keyboard/Keyboard.js',
|
||||
'../Libraries/LayoutAnimation/LayoutAnimation.js',
|
||||
|
||||
Reference in New Issue
Block a user