mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-03 02:42:05 +00:00
Add ES module export
Preparation for publishing an ES module build. Move 'modality' into 'createDOMElement' to ensure it is always initialized.
This commit is contained in:
@@ -27,7 +27,7 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'react-native': path.join(__dirname, '../../src')
|
'react-native': path.join(__dirname, '../../src/module')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'react-native': path.join(__dirname, '../src')
|
'react-native': path.join(__dirname, '../src/module')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+50
-47
@@ -1,54 +1,57 @@
|
|||||||
import createDOMElement from './modules/createDOMElement';
|
import {
|
||||||
import findNodeHandle from './modules/findNodeHandle';
|
// top-level API
|
||||||
import modality from './modules/modality';
|
findNodeHandle,
|
||||||
import NativeModules from './modules/NativeModules';
|
render,
|
||||||
import processColor from './modules/processColor';
|
unmountComponentAtNode,
|
||||||
import { render, unmountComponentAtNode } from 'react-dom';
|
|
||||||
|
|
||||||
// APIs
|
// modules
|
||||||
import Animated from './apis/Animated';
|
createDOMElement,
|
||||||
import AppRegistry from './apis/AppRegistry';
|
NativeModules,
|
||||||
import AppState from './apis/AppState';
|
processColor,
|
||||||
import AsyncStorage from './apis/AsyncStorage';
|
|
||||||
import BackAndroid from './apis/BackAndroid';
|
|
||||||
import Clipboard from './apis/Clipboard';
|
|
||||||
import Dimensions from './apis/Dimensions';
|
|
||||||
import Easing from 'animated/lib/Easing';
|
|
||||||
import I18nManager from './apis/I18nManager';
|
|
||||||
import InteractionManager from './apis/InteractionManager';
|
|
||||||
import Linking from './apis/Linking';
|
|
||||||
import NetInfo from './apis/NetInfo';
|
|
||||||
import PanResponder from './apis/PanResponder';
|
|
||||||
import PixelRatio from './apis/PixelRatio';
|
|
||||||
import Platform from './apis/Platform';
|
|
||||||
import StyleSheet from './apis/StyleSheet';
|
|
||||||
import UIManager from './apis/UIManager';
|
|
||||||
import Vibration from './apis/Vibration';
|
|
||||||
|
|
||||||
// components
|
// APIs
|
||||||
import ActivityIndicator from './components/ActivityIndicator';
|
Animated,
|
||||||
import Button from './components/Button';
|
AppRegistry,
|
||||||
import Image from './components/Image';
|
AppState,
|
||||||
import ListView from './components/ListView';
|
AsyncStorage,
|
||||||
import ProgressBar from './components/ProgressBar';
|
BackAndroid,
|
||||||
import ScrollView from './components/ScrollView';
|
Clipboard,
|
||||||
import StatusBar from './components/StatusBar';
|
Dimensions,
|
||||||
import Switch from './components/Switch';
|
Easing,
|
||||||
import Text from './components/Text';
|
I18nManager,
|
||||||
import TextInput from './components/TextInput';
|
InteractionManager,
|
||||||
import Touchable from './components/Touchable/Touchable';
|
Linking,
|
||||||
import TouchableHighlight from './components/Touchable/TouchableHighlight';
|
NetInfo,
|
||||||
import TouchableOpacity from './components/Touchable/TouchableOpacity';
|
PanResponder,
|
||||||
import TouchableWithoutFeedback from './components/Touchable/TouchableWithoutFeedback';
|
PixelRatio,
|
||||||
import View from './components/View';
|
Platform,
|
||||||
|
StyleSheet,
|
||||||
|
UIManager,
|
||||||
|
Vibration,
|
||||||
|
|
||||||
// propTypes
|
// components
|
||||||
import ColorPropType from './propTypes/ColorPropType';
|
ActivityIndicator,
|
||||||
import EdgeInsetsPropType from './propTypes/EdgeInsetsPropType';
|
Button,
|
||||||
import PointPropType from './propTypes/PointPropType';
|
Image,
|
||||||
import ViewPropTypes from './components/View/ViewPropTypes';
|
ListView,
|
||||||
|
ProgressBar,
|
||||||
|
ScrollView,
|
||||||
|
StatusBar,
|
||||||
|
Switch,
|
||||||
|
Text,
|
||||||
|
TextInput,
|
||||||
|
Touchable,
|
||||||
|
TouchableHighlight,
|
||||||
|
TouchableOpacity,
|
||||||
|
TouchableWithoutFeedback,
|
||||||
|
View,
|
||||||
|
|
||||||
modality();
|
// propTypes
|
||||||
|
ColorPropType,
|
||||||
|
EdgeInsetsPropType,
|
||||||
|
PointPropType,
|
||||||
|
ViewPropTypes
|
||||||
|
} from './module';
|
||||||
|
|
||||||
const ReactNative = {
|
const ReactNative = {
|
||||||
// top-level API
|
// top-level API
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
export { default as createDOMElement } from './modules/createDOMElement';
|
||||||
|
export { default as findNodeHandle } from './modules/findNodeHandle';
|
||||||
|
export { default as NativeModules } from './modules/NativeModules';
|
||||||
|
export { default as processColor } from './modules/processColor';
|
||||||
|
export { render, unmountComponentAtNode } from 'react-dom';
|
||||||
|
|
||||||
|
// APIs
|
||||||
|
export { default as Animated } from './apis/Animated';
|
||||||
|
export { default as AppRegistry } from './apis/AppRegistry';
|
||||||
|
export { default as AppState } from './apis/AppState';
|
||||||
|
export { default as AsyncStorage } from './apis/AsyncStorage';
|
||||||
|
export { default as BackAndroid } from './apis/BackAndroid';
|
||||||
|
export { default as Clipboard } from './apis/Clipboard';
|
||||||
|
export { default as Dimensions } from './apis/Dimensions';
|
||||||
|
export { default as Easing } from 'animated/lib/Easing';
|
||||||
|
export { default as I18nManager } from './apis/I18nManager';
|
||||||
|
export { default as InteractionManager } from './apis/InteractionManager';
|
||||||
|
export { default as Linking } from './apis/Linking';
|
||||||
|
export { default as NetInfo } from './apis/NetInfo';
|
||||||
|
export { default as PanResponder } from './apis/PanResponder';
|
||||||
|
export { default as PixelRatio } from './apis/PixelRatio';
|
||||||
|
export { default as Platform } from './apis/Platform';
|
||||||
|
export { default as StyleSheet } from './apis/StyleSheet';
|
||||||
|
export { default as UIManager } from './apis/UIManager';
|
||||||
|
export { default as Vibration } from './apis/Vibration';
|
||||||
|
|
||||||
|
// components
|
||||||
|
export { default as ActivityIndicator } from './components/ActivityIndicator';
|
||||||
|
export { default as Button } from './components/Button';
|
||||||
|
export { default as Image } from './components/Image';
|
||||||
|
export { default as ListView } from './components/ListView';
|
||||||
|
export { default as ProgressBar } from './components/ProgressBar';
|
||||||
|
export { default as ScrollView } from './components/ScrollView';
|
||||||
|
export { default as StatusBar } from './components/StatusBar';
|
||||||
|
export { default as Switch } from './components/Switch';
|
||||||
|
export { default as Text } from './components/Text';
|
||||||
|
export { default as TextInput } from './components/TextInput';
|
||||||
|
export { default as Touchable } from './components/Touchable/Touchable';
|
||||||
|
export { default as TouchableHighlight } from './components/Touchable/TouchableHighlight';
|
||||||
|
export { default as TouchableOpacity } from './components/Touchable/TouchableOpacity';
|
||||||
|
export {
|
||||||
|
default as TouchableWithoutFeedback
|
||||||
|
} from './components/Touchable/TouchableWithoutFeedback';
|
||||||
|
export { default as View } from './components/View';
|
||||||
|
|
||||||
|
// propTypes
|
||||||
|
export { default as ColorPropType } from './propTypes/ColorPropType';
|
||||||
|
export { default as EdgeInsetsPropType } from './propTypes/EdgeInsetsPropType';
|
||||||
|
export { default as PointPropType } from './propTypes/PointPropType';
|
||||||
|
export { default as ViewPropTypes } from './components/View/ViewPropTypes';
|
||||||
@@ -2,9 +2,12 @@ import '../injectResponderEventPlugin';
|
|||||||
|
|
||||||
import AccessibilityUtil from '../AccessibilityUtil';
|
import AccessibilityUtil from '../AccessibilityUtil';
|
||||||
import createDOMProps from '../createDOMProps';
|
import createDOMProps from '../createDOMProps';
|
||||||
|
import modality from '../modality';
|
||||||
import normalizeNativeEvent from '../normalizeNativeEvent';
|
import normalizeNativeEvent from '../normalizeNativeEvent';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
modality();
|
||||||
|
|
||||||
const eventHandlerNames = {
|
const eventHandlerNames = {
|
||||||
onClick: true,
|
onClick: true,
|
||||||
onClickCapture: true,
|
onClickCapture: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user