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

Upgrade to 0.62 #4587

Merged
merged 5 commits into from
Apr 14, 2020
Merged
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
2 changes: 1 addition & 1 deletion .ado/windows-vs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variables:
- template: variables/msbuild.yml
- template: variables/vs2019.yml
- name: reactNativeVersion
value: 0.61.5
value: 0.62.2

jobs:
- job: Setup
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "prerelease",
"comment": "Upgrade to React Native 0.62",
"packageName": "@office-iss/react-native-win32",
"email": "ngerlem@microsoft.com",
"dependentChangeType": "patch",
"date": "2020-04-14T12:18:41.888Z"
}
8 changes: 8 additions & 0 deletions change/react-native-windows-2020-04-14-05-18-46-62.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "prerelease",
"comment": "Upgrade to React Native 0.62",
"packageName": "react-native-windows",
"email": "ngerlem@microsoft.com",
"dependentChangeType": "patch",
"date": "2020-04-14T12:18:46.280Z"
}
2 changes: 1 addition & 1 deletion docs/api/react-native-windows.apptheme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
AppTheme: AppThemeModule
AppTheme: AppThemeModule | MissingNativeAppThemeShim
```
10 changes: 8 additions & 2 deletions packages/E2ETest/app/TreeDumpControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@
* Licensed under the MIT License.
*/

import { requireNativeComponent } from 'react-native';
export const TreeDumpControl = requireNativeComponent('TreeDumpControl');
import { requireNativeComponent, ViewStyle } from 'react-native';
export const TreeDumpControl = requireNativeComponent<{
style: ViewStyle;
dumpID: string;
uiaID: string;
testID: string;
additionalProperties?: string[];
}>('TreeDumpControl');
4 changes: 2 additions & 2 deletions packages/E2ETest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"dependencies": {
"react": "16.9.0",
"react-native": "0.61.5",
"react-native": "0.62.2",
"react-native-windows": "0.0.0-master.34",
"rnpm-plugin-windows": "^0.6.1"
},
Expand All @@ -33,7 +33,7 @@
"@types/jasmine": "2.8.7",
"@types/node": "^10.14.8",
"@types/react": "16.9.0",
"@types/react-native": "~0.61.5",
"@types/react-native": "^0.62.2",
"@wdio/appium-service": "5.12.1",
"@wdio/cli": "5.12.1",
"@wdio/dot-reporter": "5.12.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/microsoft-reactnative-sampleapps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
},
"dependencies": {
"react": "16.9.0",
"react-native": "0.61.5",
"react-native": "0.62.2",
"react-native-windows": "0.0.0-master.34",
"rnpm-plugin-windows": "^0.6.1"
},
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/runtime": "^7.8.4",
"@types/react": "16.9.0",
"@types/react-native": "~0.61.5",
"@types/react-native": "^0.62.2",
"just-scripts": "^0.36.1",
"metro-react-native-babel-preset": "^0.56.0",
"react-test-renderer": "16.9.0"
Expand Down
10 changes: 4 additions & 6 deletions packages/override-tools/src/Cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ async function addOverride(overridePath: string) {
* Remove an override from the manifest
*/
async function removeOverride(overridePath: string) {
await checkFileExists('override', overridePath);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checkFileExists [](start = 8, length = 15)

Removed this so that we can delete overrides from the manifest easily if the actual file goes away


const manifestPath = await FileSearch.findManifest(overridePath);
const manifestDir = path.dirname(manifestPath);

Expand Down Expand Up @@ -330,31 +328,31 @@ function printValidationErrors(errors: Array<ValidationError>) {

if (filesMissing.length > 0) {
const errorMessage =
"Found override files that aren't listed in the manifest. Overrides can be added to the manifest by using 'yarn override add <override>':";
"Found override files that aren't listed in the manifest. Overrides can be added to the manifest by using 'yarn override add <override>' (where override is package relative):";
console.error(chalk.red(errorMessage));
filesMissing.forEach(err => console.error(` - ${err.file}`));
console.error();
}

if (overridesMissing.length > 0) {
const errorMessage =
"Found overrides in the manifest that don't exist on disk. Remove existing overrides using 'yarn override remove <override>':";
"Found overrides in the manifest that don't exist on disk. Remove existing overrides using 'yarn override remove <override>' (where override is package relative):";
console.error(chalk.red(errorMessage));
overridesMissing.forEach(err => console.error(` - ${err.file}`));
console.error();
}

if (baseFilesNotFound.length > 0) {
const errorMessage =
"Found overrides whose original files do not exist. Remove existing overrides using 'yarn override remove <override>':";
"Found overrides whose original files do not exist. Remove existing overrides using 'yarn override remove <override>' (where override is package relative):";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relative [](start = 151, length = 8)

So, this is kind of annoying. yarn will lie about cwd and always pretend you're running the script from the package directory. npx doesn't run into this, but will also go download the override npm package if one isn't found, and we've seen issues before where yarn doesn't link the override bin correctly without a force or clean install,.

console.error(chalk.red(errorMessage));
baseFilesNotFound.forEach(err => console.error(` - ${err.file}`));
console.error();
}

if (outOfDateFiles.length > 0) {
const errorMessage =
"Found overrides whose original files have changed. Upgrade overrides using 'yarn override auto-upgrade <override>' and 'yarn override manual-upgrade <override>':";
"Found overrides whose original files have changed. Upgrade overrides using 'yarn override auto-upgrade <manifest>' and 'yarn override manual-upgrade <manifest>' (where manifest is package relative):";
console.error(chalk.red(errorMessage));
outOfDateFiles.forEach(err => console.error(` - ${err.file}`));
console.error();
Expand Down
2 changes: 1 addition & 1 deletion packages/override-tools/src/Manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default class Manifest {
const baseFile = override.baseFile;
const baseContent = await this.reactRepo.getFileContents(baseFile);
if (baseContent === null) {
errors.push({type: 'baseFileNotFound', file: override.baseFile});
errors.push({type: 'baseFileNotFound', file: override.file});
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file [](start = 64, length = 4)

Small change for consistency

return;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/override-tools/src/test/Manifest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ test('BaseFileNotFound', async () => {

const expectedError: ValidationError = {
type: 'baseFileNotFound',
file: 'foo\\bar.js',
file: 'aaa\\aaa.windows.js',
};

const testManifest = new Manifest(ourManifestData, ovrRepo, reactRepo);
Expand Down
4 changes: 2 additions & 2 deletions packages/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
},
"dependencies": {
"react": "16.9.0",
"react-native": "0.61.5",
"react-native": "0.62.2",
"react-native-windows": "0.0.0-master.34"
},
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/runtime": "^7.8.4",
"@types/react": "16.9.0",
"@types/react-native": "~0.61.5",
"@types/react-native": "^0.62.2",
"just-scripts": "^0.36.1",
"metro-react-native-babel-preset": "^0.56.0",
"react-test-renderer": "16.9.0",
Expand Down
60 changes: 20 additions & 40 deletions packages/react-native-win32/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,30 @@
; initRNLibraries build step
<PROJECT_ROOT>/Libraries/Alert/Alert.js
<PROJECT_ROOT>/Libraries/Animated/src/nodes/AnimatedInterpolation.js
<PROJECT_ROOT>/Libraries/Color/normalizeColor.js
<PROJECT_ROOT>/Libraries/Color/normalizeColorObject.js
<PROJECT_ROOT>/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfo.js
<PROJECT_ROOT>/Libraries/Components/Picker/Picker.js
<PROJECT_ROOT>/Libraries/Components/SafeAreaView/SafeAreaView.js
<PROJECT_ROOT>/Libraries/Components/StatusBar/StatusBar.js
<PROJECT_ROOT>/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.js
<PROJECT_ROOT>/Libraries/Components/TextInput/TextInput.js
<PROJECT_ROOT>/Libraries/Components/TextInput/TextInputState.js
<PROJECT_ROOT>/Libraries/Components/Touchable/TouchableBounce.js
<PROJECT_ROOT>/Libraries/Components/Touchable/TouchableHighlight.js
<PROJECT_ROOT>/Libraries/Components/Touchable/TouchableNativeFeedback.js
<PROJECT_ROOT>/Libraries/Components/Touchable/TouchableOpacity.js
<PROJECT_ROOT>/Libraries/Components/Touchable/TouchableWithoutFeedback.js
<PROJECT_ROOT>/Libraries/Components/View/ReactNativeViewAttributes.js
<PROJECT_ROOT>/Libraries/Components/View/ReactNativeViewViewConfig.js
<PROJECT_ROOT>/Libraries/Core/setUpDeveloperTools.js
<PROJECT_ROOT>/Libraries/Core/setUpReactDevTools.js
<PROJECT_ROOT>/Libraries/Image/Image.js
<PROJECT_ROOT>/Libraries/Image/ImageViewNativeComponent.js
<PROJECT_ROOT>/Libraries/Inspector/Inspector.js
<PROJECT_ROOT>/Libraries/Inspector/InspectorOverlay.js
<PROJECT_ROOT>/Libraries/Network/RCTNetworking.js
<PROJECT_ROOT>/Libraries/Pressability/PressabilityDebug.js
<PROJECT_ROOT>/Libraries/ReactNative/getNativeComponentAttributes.js
<PROJECT_ROOT>/Libraries/StyleSheet/normalizeColor.js
<PROJECT_ROOT>/Libraries/StyleSheet/normalizeColorObject.js
<PROJECT_ROOT>/Libraries/StyleSheet/processColor.js
<PROJECT_ROOT>/Libraries/StyleSheet/processColorArray.js
<PROJECT_ROOT>/Libraries/StyleSheet/StyleSheet.js
Expand All @@ -39,10 +46,6 @@
<PROJECT_ROOT>/RNTester/js/components/ListExampleShared.js
<PROJECT_ROOT>/RNTester/js/components/RNTesterExampleFilter.js

; These examples currently uses mac dynamic colors
<PROJECT_ROOT>/RNTester/js/ActivityIndicatorExample.js
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DarkModeExample doesn't exist in the repo and the top doesn't seem to have issues? Removed the suppression.

<PROJECT_ROOT>/RNTester/js/DarkModeExample.js

; Schema files are used for turbo-module code generation, but are not bundled.
; We don't yet have the react-native-codegen package they rely on, so supress
; checks for now.
Expand Down Expand Up @@ -72,11 +75,6 @@
; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*

; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

native [](start = 19, length = 6)

the react-native dir got nuked, but React.js didn't exist in there anyway? Cleaned this up


; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
.*/node_modules/warning/.*
Expand All @@ -102,7 +100,7 @@
../../node_modules/

[libs]
Libraries/react-native/react-native-interface.js
interface.js
flow/

[options]
Expand All @@ -115,34 +113,10 @@ module.file_ext=.js
module.file_ext=.json
module.file_ext=.win32.js

module.system=haste
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

system [](start = 7, length = 6)

We should have gotten rid of this in the 61 timeframe, since we no longer use Haste and this can lead to flow following the wrong requires

module.system.haste.use_name_reducers=true
# keep the following in sync with server/haste/hasteImpl.js
# get basename
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
# strip .js or .js.flow suffix
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
# strip .ios suffix
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.macos$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.win32$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.windesktop$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
module.system.haste.paths.blacklist=<PROJECT_ROOT>/src/.*
module.system.haste.paths.blacklist=.*/__tests__/.*
module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/Libraries/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/RNTester/.*
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.system.haste.paths.blacklist=<PROJECT_ROOT>/Libraries/Image/resolveAssetSource.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'
module.name_mapper='react-native$' -> '<PROJECT_ROOT>/Libraries/react-native/react-native-implementation.js'
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\)$' -> '<PROJECT_ROOT>/Libraries/Image/RelativeImageStub'
module.name_mapper='react-native$' -> '<PROJECT_ROOT>/index.js'
module.name_mapper='react-native/\(.*\)' -> '<PROJECT_ROOT>/\1'

suppress_type=$FlowIssue
Expand All @@ -153,8 +127,14 @@ suppress_type=$FlowFixMeEmpty

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_android\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suppress_comment [](start = 0, length = 16)

We derive from both Android and iOS files, so I added the Android specific flow suppressions in addition to the existing iOS ones.

suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_android\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

experimental.well_formed_exports=true
experimental.types_first=true
experimental.abstract_locations=true

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
Expand All @@ -178,4 +158,4 @@ untyped-import
untyped-type-import

[version]
^0.105.0
^0.113.0
4 changes: 2 additions & 2 deletions packages/react-native-win32/.gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/dist
/flow
/flow-typed
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flow-typed [](start = 1, length = 10)

We haven't copied this in a while, since it's not part of the published RN package

/index.*
/interface.*
/IntegrationTests
/jest
/lib
/Libraries
/RNTester
/RNTester.*
/temp
/WorkingHeaders
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WorkingHeaders [](start = 1, length = 14)

This has been gone long enough that I should be able to clean it up now without annoying everyone

/typings-index.*
2 changes: 1 addition & 1 deletion packages/react-native-win32/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "./Libraries/react-native/typings-main.d.ts",
"mainEntryPointFilePath": "./typings-index.d.ts",
"docModel": {
"enabled": true
},
Expand Down
16 changes: 8 additions & 8 deletions packages/react-native-win32/etc/react-native-win32.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export type BasePropsWin32 = {
accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;
};

// Warning: (ae-forgotten-export) The symbol "IButtonWin32State" needs to be exported by the entry point typings-main.d.ts
// Warning: (ae-forgotten-export) The symbol "IButtonWin32State" needs to be exported by the entry point typings-index.d.ts
//
// @public
export class ButtonWin32 extends React_2.Component<IButtonWin32Props, IButtonWin32State> {
Expand Down Expand Up @@ -89,7 +89,7 @@ export interface IButtonWin32Props extends RN.ButtonProps {
style?: RN.StyleProp<IButtonWin32Style>;
}

// Warning: (ae-forgotten-export) The symbol "Omit" needs to be exported by the entry point typings-main.d.ts
// Warning: (ae-forgotten-export) The symbol "Omit" needs to be exported by the entry point typings-index.d.ts
//
// @public (undocumented)
export interface IButtonWin32Style extends Omit_4<RN.TextStyle, ButtonWin32OmitStyles> {
Expand All @@ -106,7 +106,7 @@ export interface IDimensions {
width: number;
}

// Warning: (ae-forgotten-export) The symbol "PartiallyRequired" needs to be exported by the entry point typings-main.d.ts
// Warning: (ae-forgotten-export) The symbol "PartiallyRequired" needs to be exported by the entry point typings-index.d.ts
//
// @public (undocumented)
export type IHandledKeyboardEvent = PartiallyRequired<INativeKeyboardEvent, 'key'>;
Expand Down Expand Up @@ -152,7 +152,7 @@ export interface IPersonaCoinProps extends ViewProps {
presence: PersonaCoinPresence;
// (undocumented)
size: PersonaCoinSize;
// Warning: (ae-forgotten-export) The symbol "IImageSourceProps" needs to be exported by the entry point typings-main.d.ts
// Warning: (ae-forgotten-export) The symbol "IImageSourceProps" needs to be exported by the entry point typings-index.d.ts
//
// (undocumented)
source?: string | IImageSourceProps;
Expand Down Expand Up @@ -220,7 +220,7 @@ export type IStateConditions = {
[P in IState]: boolean;
};

// Warning: (ae-forgotten-export) The symbol "Omit" needs to be exported by the entry point typings-main.d.ts
// Warning: (ae-forgotten-export) The symbol "Omit" needs to be exported by the entry point typings-index.d.ts
//
// @public (undocumented)
export interface ITextWin32Props extends Omit_3<RN.TextProps, TextWin32OmitTypes>, BasePropsWin32 {
Expand Down Expand Up @@ -302,7 +302,7 @@ export interface ITouchInfo {
touchActive: boolean;
}

// Warning: (ae-forgotten-export) The symbol "ISignalTransitions" needs to be exported by the entry point typings-main.d.ts
// Warning: (ae-forgotten-export) The symbol "ISignalTransitions" needs to be exported by the entry point typings-index.d.ts
//
// @public
export type ITransitions = {
Expand All @@ -315,7 +315,7 @@ export interface IViewWin32 {
focus: () => void;
}

// Warning: (ae-forgotten-export) The symbol "Omit" needs to be exported by the entry point typings-main.d.ts
// Warning: (ae-forgotten-export) The symbol "Omit" needs to be exported by the entry point typings-index.d.ts
//
// @public
export interface IViewWin32Props extends Omit_2<RN.ViewProps, ViewWin32OmitTypes>, BasePropsWin32 {
Expand Down Expand Up @@ -425,7 +425,7 @@ export class TextWin32 extends React_2.Component<ITextWin32Props, {}> {
// @public (undocumented)
export type TextWin32OmitTypes = RN.TextPropsAndroid & RN.TextPropsIOS & RN.AccessibilityPropsAndroid & Omit_3<RN.AccessibilityPropsIOS, SharedAccessibilityPropsIOSandWin32> & OmittedAccessibilityPropsWin32;

// Warning: (ae-forgotten-export) The symbol "IInternalTouchableWin32State" needs to be exported by the entry point typings-main.d.ts
// Warning: (ae-forgotten-export) The symbol "IInternalTouchableWin32State" needs to be exported by the entry point typings-index.d.ts
//
// @public
export class TouchableWin32 extends React_2.Component<ITouchableWin32Props, IInternalTouchableWin32State> {
Expand Down
Loading