Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[standards] Rewrite imports in YellowBox to use standard paths #24320

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ module.system.haste.paths.whitelist=<PROJECT_ROOT>/IntegrationTests/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/Libraries/react-native/react-native-implementation.js
module.system.haste.paths.blacklist=<PROJECT_ROOT>/Libraries/Animated/src/polyfills/.*

module.file_ext=.js
module.file_ext=.json
module.file_ext=.ios.js

munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
Expand Down
4 changes: 4 additions & 0 deletions .flowconfig.android
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ emoji=true
esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.file_ext=.js
module.file_ext=.json
module.file_ext=.android.js

module.system=haste
module.system.haste.use_name_reducers=true
# keep the following in sync with server/haste/hasteImpl.js
Expand Down
10 changes: 5 additions & 5 deletions Libraries/YellowBox/Data/YellowBoxCategory.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

'use strict';

const React = require('React');
const Text = require('Text');
const UTFSequence = require('UTFSequence');
const React = require('react');
const Text = require('../../Text/Text');
const UTFSequence = require('../../UTFSequence');

const stringifySafe = require('stringifySafe');
const stringifySafe = require('../../Utilities/stringifySafe');

import type {TextStyleProp} from 'StyleSheet';
import type {TextStyleProp} from '../../StyleSheet/StyleSheet';

export type Category = string;
export type Message = $ReadOnly<{|
Expand Down
4 changes: 2 additions & 2 deletions Libraries/YellowBox/Data/YellowBoxRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

'use strict';

const YellowBoxWarning = require('YellowBoxWarning');
const YellowBoxWarning = require('./YellowBoxWarning');

import type {Category} from 'YellowBoxCategory';
import type {Category} from './YellowBoxCategory';

export type Registry = Map<Category, $ReadOnlyArray<YellowBoxWarning>>;

Expand Down
4 changes: 2 additions & 2 deletions Libraries/YellowBox/Data/YellowBoxSymbolication.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

'use strict';

const symbolicateStackTrace = require('symbolicateStackTrace');
const symbolicateStackTrace = require('../../Core/Devtools/symbolicateStackTrace');

import type {StackFrame} from 'parseErrorStack';
import type {StackFrame} from '../../Core/Devtools/parseErrorStack';

type CacheKey = string;

Expand Down
10 changes: 5 additions & 5 deletions Libraries/YellowBox/Data/YellowBoxWarning.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

'use strict';

const YellowBoxCategory = require('YellowBoxCategory');
const YellowBoxSymbolication = require('YellowBoxSymbolication');
const YellowBoxCategory = require('./YellowBoxCategory');
const YellowBoxSymbolication = require('./YellowBoxSymbolication');

const parseErrorStack = require('parseErrorStack');
const parseErrorStack = require('../../Core/Devtools/parseErrorStack');

import type {Category, Message} from 'YellowBoxCategory';
import type {Stack} from 'YellowBoxSymbolication';
import type {Category, Message} from './YellowBoxCategory';
import type {Stack} from './YellowBoxSymbolication';

export type SymbolicationRequest = $ReadOnly<{|
abort: () => void,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

'use strict';

const YellowBoxCategory = require('YellowBoxCategory');
const YellowBoxCategory = require('../YellowBoxCategory');

describe('YellowBoxCategory', () => {
it('parses strings', () => {
Expand Down
4 changes: 2 additions & 2 deletions Libraries/YellowBox/Data/__tests__/YellowBoxRegistry-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

'use strict';

const YellowBoxCategory = require('YellowBoxCategory');
const YellowBoxRegistry = require('YellowBoxRegistry');
const YellowBoxCategory = require('../YellowBoxCategory');
const YellowBoxRegistry = require('../YellowBoxRegistry');

const registry = () => {
const observer = jest.fn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@

'use strict';

import type {StackFrame} from 'parseErrorStack';
import type {StackFrame} from '../../../Core/Devtools/parseErrorStack';

jest.mock('symbolicateStackTrace');
jest.mock('../../../Core/Devtools/symbolicateStackTrace');

const YellowBoxSymbolication = require('YellowBoxSymbolication');
const YellowBoxSymbolication = require('../YellowBoxSymbolication');

const symbolicateStackTrace: JestMockFn<
$ReadOnlyArray<Array<StackFrame>>,
Promise<Array<StackFrame>>,
> = (require('symbolicateStackTrace'): any);
> = (require('../../../Core/Devtools/symbolicateStackTrace'): any);

const createStack = methodNames =>
methodNames.map(methodName => ({
Expand Down
8 changes: 4 additions & 4 deletions Libraries/YellowBox/Data/__tests__/YellowBoxWarning-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@

'use strict';

import type {StackFrame} from 'parseErrorStack';
import type {StackFrame} from '../../../Core/Devtools/parseErrorStack';

jest.mock('YellowBoxSymbolication');
jest.mock('../YellowBoxSymbolication');

const YellowBoxSymbolication: {|
symbolicate: JestMockFn<
$ReadOnlyArray<Array<StackFrame>>,
Promise<Array<StackFrame>>,
>,
|} = (require('YellowBoxSymbolication'): any);
const YellowBoxWarning = require('YellowBoxWarning');
|} = (require('../YellowBoxSymbolication'): any);
const YellowBoxWarning = require('../YellowBoxWarning');

const createStack = methodNames =>
methodNames.map(methodName => ({
Expand Down
12 changes: 6 additions & 6 deletions Libraries/YellowBox/UI/YellowBoxButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

'use strict';

const React = require('React');
const StyleSheet = require('StyleSheet');
const Text = require('Text');
const YellowBoxPressable = require('YellowBoxPressable');
const YellowBoxStyle = require('YellowBoxStyle');
const React = require('react');
const StyleSheet = require('../../StyleSheet/StyleSheet');
const Text = require('../../Text/Text');
const YellowBoxPressable = require('./YellowBoxPressable');
const YellowBoxStyle = require('./YellowBoxStyle');

import type {EdgeInsetsProp} from 'EdgeInsetsPropType';
import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType';

type Props = $ReadOnly<{|
hitSlop?: ?EdgeInsetsProp,
Expand Down
2 changes: 1 addition & 1 deletion Libraries/YellowBox/UI/YellowBoxImageSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

'use strict';

const PixelRatio = require('PixelRatio');
const PixelRatio = require('../../Utilities/PixelRatio');

const scale = PixelRatio.get();

Expand Down
34 changes: 17 additions & 17 deletions Libraries/YellowBox/UI/YellowBoxInspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@

'use strict';

const Platform = require('Platform');
const React = require('React');
const ScrollView = require('ScrollView');
const StyleSheet = require('StyleSheet');
const Text = require('Text');
const View = require('View');
const YellowBoxCategory = require('YellowBoxCategory');
const YellowBoxInspectorFooter = require('YellowBoxInspectorFooter');
const YellowBoxInspectorHeader = require('YellowBoxInspectorHeader');
const YellowBoxInspectorSourceMapStatus = require('YellowBoxInspectorSourceMapStatus');
const YellowBoxInspectorStackFrame = require('YellowBoxInspectorStackFrame');
const YellowBoxStyle = require('YellowBoxStyle');

const openFileInEditor = require('openFileInEditor');

import type YellowBoxWarning from 'YellowBoxWarning';
import type {SymbolicationRequest} from 'YellowBoxWarning';
const Platform = require('../../Utilities/Platform');
const React = require('react');
const ScrollView = require('../../Components/ScrollView/ScrollView');
const StyleSheet = require('../../StyleSheet/StyleSheet');
const Text = require('../../Text/Text');
const View = require('../../Components/View/View');
const YellowBoxCategory = require('../Data/YellowBoxCategory');
const YellowBoxInspectorFooter = require('./YellowBoxInspectorFooter');
const YellowBoxInspectorHeader = require('./YellowBoxInspectorHeader');
const YellowBoxInspectorSourceMapStatus = require('./YellowBoxInspectorSourceMapStatus');
const YellowBoxInspectorStackFrame = require('./YellowBoxInspectorStackFrame');
const YellowBoxStyle = require('./YellowBoxStyle');

const openFileInEditor = require('../../Core/Devtools/openFileInEditor');

import type YellowBoxWarning from '../Data/YellowBoxWarning';
import type {SymbolicationRequest} from '../Data/YellowBoxWarning';

type Props = $ReadOnly<{|
onDismiss: () => void,
Expand Down
14 changes: 7 additions & 7 deletions Libraries/YellowBox/UI/YellowBoxInspectorFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

'use strict';

const React = require('React');
const SafeAreaView = require('SafeAreaView');
const StyleSheet = require('StyleSheet');
const Text = require('Text');
const View = require('View');
const YellowBoxPressable = require('YellowBoxPressable');
const YellowBoxStyle = require('YellowBoxStyle');
const React = require('react');
const SafeAreaView = require('../../Components/SafeAreaView/SafeAreaView');
const StyleSheet = require('../../StyleSheet/StyleSheet');
const Text = require('../../Text/Text');
const View = require('../../Components/View/View');
const YellowBoxPressable = require('./YellowBoxPressable');
const YellowBoxStyle = require('./YellowBoxStyle');

type Props = $ReadOnly<{|
onDismiss: () => void,
Expand Down
22 changes: 11 additions & 11 deletions Libraries/YellowBox/UI/YellowBoxInspectorHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@

'use strict';

const Image = require('Image');
const Platform = require('Platform');
const React = require('React');
const SafeAreaView = require('SafeAreaView');
const StyleSheet = require('StyleSheet');
const Text = require('Text');
const View = require('View');
const YellowBoxImageSource = require('YellowBoxImageSource');
const YellowBoxPressable = require('YellowBoxPressable');
const YellowBoxStyle = require('YellowBoxStyle');
const Image = require('../../Image/Image');
const Platform = require('../../Utilities/Platform');
const React = require('react');
const SafeAreaView = require('../../Components/SafeAreaView/SafeAreaView');
const StyleSheet = require('../../StyleSheet/StyleSheet');
const Text = require('../../Text/Text');
const View = require('../../Components/View/View');
const YellowBoxImageSource = require('./YellowBoxImageSource');
const YellowBoxPressable = require('./YellowBoxPressable');
const YellowBoxStyle = require('./YellowBoxStyle');

import type YellowBoxWarning from 'YellowBoxWarning';
import type YellowBoxWarning from '../Data/YellowBoxWarning';

type Props = $ReadOnly<{|
onSelectIndex: (selectedIndex: number) => void,
Expand Down
22 changes: 11 additions & 11 deletions Libraries/YellowBox/UI/YellowBoxInspectorSourceMapStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@

'use strict';

const Animated = require('Animated');
const Easing = require('Easing');
const React = require('React');
const StyleSheet = require('StyleSheet');
const Text = require('Text');
const YellowBoxImageSource = require('YellowBoxImageSource');
const YellowBoxPressable = require('YellowBoxPressable');
const YellowBoxStyle = require('YellowBoxStyle');
const Animated = require('../../Animated/src/Animated');
const Easing = require('../../Animated/src/Easing');
const React = require('react');
const StyleSheet = require('../../StyleSheet/StyleSheet');
const Text = require('../../Text/Text');
const YellowBoxImageSource = require('./YellowBoxImageSource');
const YellowBoxPressable = require('./YellowBoxPressable');
const YellowBoxStyle = require('./YellowBoxStyle');

import type {CompositeAnimation} from 'AnimatedImplementation';
import type AnimatedInterpolation from 'AnimatedInterpolation';
import type {PressEvent} from 'CoreEventTypes';
import type {CompositeAnimation} from '../../Animated/src/AnimatedImplementation';
import type AnimatedInterpolation from '../../Animated/src/nodes/AnimatedInterpolation';
import type {PressEvent} from '../../Types/CoreEventTypes';

type Props = $ReadOnly<{|
onPress?: ?(event: PressEvent) => void,
Expand Down
14 changes: 7 additions & 7 deletions Libraries/YellowBox/UI/YellowBoxInspectorStackFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

'use strict';

const React = require('React');
const StyleSheet = require('StyleSheet');
const Text = require('Text');
const YellowBoxPressable = require('YellowBoxPressable');
const YellowBoxStyle = require('YellowBoxStyle');
const React = require('react');
const StyleSheet = require('../../StyleSheet/StyleSheet');
const Text = require('../../Text/Text');
const YellowBoxPressable = require('./YellowBoxPressable');
const YellowBoxStyle = require('./YellowBoxStyle');

import type {PressEvent} from 'CoreEventTypes';
import type {StackFrame} from 'parseErrorStack';
import type {PressEvent} from '../../Types/CoreEventTypes';
import type {StackFrame} from '../../Core/Devtools/parseErrorStack';

type Props = $ReadOnly<{|
frame: StackFrame,
Expand Down
26 changes: 13 additions & 13 deletions Libraries/YellowBox/UI/YellowBoxList.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@

'use strict';

const Dimensions = require('Dimensions');
const React = require('React');
const FlatList = require('FlatList');
const SafeAreaView = require('SafeAreaView');
const StyleSheet = require('StyleSheet');
const View = require('View');
const YellowBoxButton = require('YellowBoxButton');
const YellowBoxInspector = require('YellowBoxInspector');
const YellowBoxListRow = require('YellowBoxListRow');
const YellowBoxStyle = require('YellowBoxStyle');

import type {Category} from 'YellowBoxCategory';
import type {Registry} from 'YellowBoxRegistry';
const Dimensions = require('../../Utilities/Dimensions');
const React = require('react');
const FlatList = require('../../Lists/FlatList');
const SafeAreaView = require('../../Components/SafeAreaView/SafeAreaView');
const StyleSheet = require('../../StyleSheet/StyleSheet');
const View = require('../../Components/View/View');
const YellowBoxButton = require('./YellowBoxButton');
const YellowBoxInspector = require('./YellowBoxInspector');
const YellowBoxListRow = require('./YellowBoxListRow');
const YellowBoxStyle = require('./YellowBoxStyle');

import type {Category} from '../Data/YellowBoxCategory';
import type {Registry} from '../Data/YellowBoxRegistry';

type Props = $ReadOnly<{|
onDismiss: (category: Category) => void,
Expand Down
18 changes: 9 additions & 9 deletions Libraries/YellowBox/UI/YellowBoxListRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@

'use strict';

const React = require('React');
const StyleSheet = require('StyleSheet');
const Text = require('Text');
const YellowBoxPressable = require('YellowBoxPressable');
const View = require('View');
const YellowBoxCategory = require('YellowBoxCategory');
const YellowBoxStyle = require('YellowBoxStyle');
const YellowBoxWarning = require('YellowBoxWarning');
const React = require('react');
const StyleSheet = require('../../StyleSheet/StyleSheet');
const Text = require('../../Text/Text');
const YellowBoxPressable = require('./YellowBoxPressable');
const View = require('../../Components/View/View');
const YellowBoxCategory = require('../Data/YellowBoxCategory');
const YellowBoxStyle = require('./YellowBoxStyle');
const YellowBoxWarning = require('../Data/YellowBoxWarning');

import type {Category} from 'YellowBoxCategory';
import type {Category} from '../Data/YellowBoxCategory';

type Props = $ReadOnly<{|
category: Category,
Expand Down
Loading