mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Migrate StyleSheet/processColorArray.js to use export syntax (#48905)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48905 ## Motivation Modernising the react-native codebase to allow for ingestion by modern Flow tooling. ## This diff - Updates `Libraries/StyleSheet/processColorArray.js` to use `export` syntax. - Appends `.default` to requires of the changed files. - Updates test files. - Updated View Config codegen (requires an MSDK bump). - Updates the public API snapshot *(intented breaking change)* Changelog: [General][Breaking] - Files inside `Libraries/Text`, `Libraries/Share` and `Libraries/Settings` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax. Reviewed By: robhogan Differential Revision: D68564304 fbshipit-source-id: 2fbd058be1a715cccfce4f2a68146118d8ac66ad
This commit is contained in:
committed by
Facebook GitHub Bot
parent
aac312da8e
commit
156ee5bee7
+1
-1
@@ -31,7 +31,7 @@ export const __INTERNAL_VIEW_CONFIG = {
|
||||
radii: true,
|
||||
|
||||
colors: {
|
||||
process: require('react-native/Libraries/StyleSheet/processColorArray'),
|
||||
process: require('react-native/Libraries/StyleSheet/processColorArray').default,
|
||||
},
|
||||
|
||||
srcs: true,
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ function getReactDiffProcessValue(typeAnnotation: PropTypeAnnotation) {
|
||||
switch (typeAnnotation.elementType.name) {
|
||||
case 'ColorPrimitive':
|
||||
return j.template
|
||||
.expression`{ process: require('react-native/Libraries/StyleSheet/processColorArray') }`;
|
||||
.expression`{ process: require('react-native/Libraries/StyleSheet/processColorArray').default }`;
|
||||
case 'ImageSourcePrimitive':
|
||||
case 'PointPrimitive':
|
||||
case 'EdgeInsetsPrimitive':
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ export const __INTERNAL_VIEW_CONFIG = {
|
||||
radii: true,
|
||||
|
||||
colors: {
|
||||
process: require('react-native/Libraries/StyleSheet/processColorArray'),
|
||||
process: require('react-native/Libraries/StyleSheet/processColorArray').default,
|
||||
},
|
||||
|
||||
srcs: true,
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ const resolveAssetSource = require('../Image/resolveAssetSource');
|
||||
const processBackgroundImage =
|
||||
require('../StyleSheet/processBackgroundImage').default;
|
||||
const processColor = require('../StyleSheet/processColor').default;
|
||||
const processColorArray = require('../StyleSheet/processColorArray');
|
||||
const processColorArray = require('../StyleSheet/processColorArray').default;
|
||||
const processFilter = require('../StyleSheet/processFilter').default;
|
||||
const insetsDiffer = require('../Utilities/differ/insetsDiffer');
|
||||
const matricesDiffer = require('../Utilities/differ/matricesDiffer');
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ const PlatformColorIOS =
|
||||
require('../PlatformColorValueTypes.ios').PlatformColor;
|
||||
const DynamicColorIOS =
|
||||
require('../PlatformColorValueTypesIOS.ios').DynamicColorIOS;
|
||||
const processColorArray = require('../processColorArray');
|
||||
const processColorArray = require('../processColorArray').default;
|
||||
|
||||
const platformSpecific =
|
||||
OS === 'android'
|
||||
|
||||
@@ -32,4 +32,4 @@ function processColorElement(color: ColorValue): ProcessedColorValue {
|
||||
return value;
|
||||
}
|
||||
|
||||
module.exports = processColorArray;
|
||||
export default processColorArray;
|
||||
|
||||
@@ -8374,7 +8374,7 @@ exports[`public API should not change unintentionally Libraries/StyleSheet/proce
|
||||
"declare function processColorArray(
|
||||
colors: ?$ReadOnlyArray<ColorValue>
|
||||
): ?$ReadOnlyArray<ProcessedColorValue>;
|
||||
declare module.exports: processColorArray;
|
||||
declare export default typeof processColorArray;
|
||||
"
|
||||
`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user