diff --git a/.ado/jobs/e2e-test.yml b/.ado/jobs/e2e-test.yml index 19cce582786..e07d0293a4d 100644 --- a/.ado/jobs/e2e-test.yml +++ b/.ado/jobs/e2e-test.yml @@ -143,3 +143,61 @@ jobs: - template: ../templates/upload-build-logs.yml parameters: buildLogDirectory: '$(BuildLogDirectory)' + - ${{ each config in parameters.buildMatrix }}: + - ${{ if eq(config.BuildEnvironment, parameters.buildEnvironment) }}: + - ${{ each matrix in config.Matrix }}: + - job: E2ETestFabric${{ matrix.Name }} + displayName: E2E Test App Fabric ${{ matrix.Name }} + + variables: [template: ../variables/windows.yml] + pool: ${{ parameters.AgentPool.Medium }} + timeoutInMinutes: 60 # how long to run the job before automatically cancelling + cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them + + steps: + - template: ../templates/checkout-shallow.yml + + - template: ../templates/prepare-js-env.yml + + - template: ../templates/prepare-build-env.yml + parameters: + platform: ${{ matrix.BuildPlatform }} + configuration: Release + buildEnvironment: ${{ config.buildEnvironment }} + + - powershell: | + Write-Host "##vso[task.setvariable variable=BuildLogDirectory]$(Build.BinariesDirectory)\${{ parameters.BuildPlatform }}\BuildLogs" + displayName: Set BuildLogDirectory + + - template: ../templates/set-experimental-feature.yml + parameters: + package: packages/e2e-test-app-fabric + feature: UseHermes + value: ${{ matrix.UseHermes }} + + - template: ../templates/msbuild-sln.yml + parameters: + solutionDir: packages/e2e-test-app-fabric/windows + solutionName: RNTesterApp-Fabric.sln + buildPlatform: ${{ matrix.BuildPlatform}} + buildConfiguration: Debug + warnAsError: false + + - task: CopyFiles@2 + displayName: Copy RNTesterApp artifacts + inputs: + sourceFolder: $(Build.SourcesDirectory)/packages/e2e-test-app-fabic/windows/RNTesterApp-Fabric + targetFolder: $(Build.StagingDirectory)/RNTesterApp-Fabric + contents: AppPackages\** + condition: failed() + + - task: PublishPipelineArtifact@1 + displayName: "Publish Artifact: RNTesterApp Fabric" + inputs: + artifactName: RNTesterApp-Fabric-${{ matrix.Name }}-$(System.JobAttempt) + targetPath: $(Build.StagingDirectory)/RNTesterApp-Fabric + condition: failed() + + - template: ../templates/upload-build-logs.yml + parameters: + buildLogDirectory: '$(BuildLogDirectory)' diff --git a/.unbroken_exclusions b/.unbroken_exclusions index 304b2acf1d9..c45218154c0 100644 --- a/.unbroken_exclusions +++ b/.unbroken_exclusions @@ -8,6 +8,7 @@ URL not found https://docs.github.com/get-started/quickstart while parsing CONTR !packages/override-tools/node_modules !packages/@office-iss/react-native-win32/node_modules !packages/e2e-test-app/node_modules +!packages/e2e-test-app-fabric/node_modules !packages/sample-apps/node_modules !packages/playground/node_modules !packages/@react-native-windows/codegen/node_modules diff --git a/lgtm.yml b/lgtm.yml index 3dd5786ff03..0c9514415ab 100644 --- a/lgtm.yml +++ b/lgtm.yml @@ -17,6 +17,7 @@ path_classifiers: - "**/packages/@react-native/tester" - "**/packages/@react-native-windows/tester" - "**/packages/e2e-test-app" + - "**/packages/e2e-test-app-fabric" - "**/packages/integration-test-app" - "**/packages/playground" - "**/packages/sample-apps" diff --git a/packages/e2e-test-app-fabric/.eslintrc.js b/packages/e2e-test-app-fabric/.eslintrc.js new file mode 100644 index 00000000000..27876cd5ef7 --- /dev/null +++ b/packages/e2e-test-app-fabric/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + extends: ['@rnw-scripts'], + parserOptions: { tsconfigRootDir: __dirname }, + globals: { + expect: 'readonly', + fail: 'readonly', + AutomationClient: 'readonly', + }, +}; diff --git a/packages/e2e-test-app-fabric/.gitignore b/packages/e2e-test-app-fabric/.gitignore new file mode 100644 index 00000000000..ae243fd8f82 --- /dev/null +++ b/packages/e2e-test-app-fabric/.gitignore @@ -0,0 +1,9 @@ +/.vscode +/node_modules +/windows/RNTesterApp-Fabric/Generated Files/ +/build +/errorShots +/reports +/dist +/windows/RNTesterApp-Fabric/Bundle/ +msbuild.binlog diff --git a/packages/e2e-test-app-fabric/.npmrc b/packages/e2e-test-app-fabric/.npmrc new file mode 100644 index 00000000000..9cf9495031e --- /dev/null +++ b/packages/e2e-test-app-fabric/.npmrc @@ -0,0 +1 @@ +package-lock=false \ No newline at end of file diff --git a/packages/e2e-test-app-fabric/README.md b/packages/e2e-test-app-fabric/README.md new file mode 100644 index 00000000000..11d6604f202 --- /dev/null +++ b/packages/e2e-test-app-fabric/README.md @@ -0,0 +1,5 @@ +# e2e-test-app-fabric project + +This package is not published, and is just used to verify a standalone app + +For information on how to run and debug this project, see [e2e-testing](https://github.com/microsoft/react-native-windows/blob/main/docs/e2e-testing.md). \ No newline at end of file diff --git a/packages/e2e-test-app-fabric/app.json b/packages/e2e-test-app-fabric/app.json new file mode 100644 index 00000000000..43998fe2248 --- /dev/null +++ b/packages/e2e-test-app-fabric/app.json @@ -0,0 +1,4 @@ +{ + "name": "RNTesterApp-Fabric", + "displayName": "RNTesterApp-Fabric" +} \ No newline at end of file diff --git a/packages/e2e-test-app-fabric/babel.config.js b/packages/e2e-test-app-fabric/babel.config.js new file mode 100644 index 00000000000..839f62a25a7 --- /dev/null +++ b/packages/e2e-test-app-fabric/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: "@rnw-scripts/babel-react-native-config", +}; \ No newline at end of file diff --git a/packages/e2e-test-app-fabric/custom-transformer.js b/packages/e2e-test-app-fabric/custom-transformer.js new file mode 100644 index 00000000000..e54b14285fd --- /dev/null +++ b/packages/e2e-test-app-fabric/custom-transformer.js @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * @format + * @ts-check + */ + +'use strict'; + +const generate = require('@babel/generator').default; +const transformer = require('metro-react-native-babel-transformer'); +module.exports = { + process(src /*: string */, file /*: string */) /*: {code: string, ...} */ { + const {ast} = transformer.transform({ + filename: file, + options: { + inlineRequires: true, + }, + src, + }); + + return generate(ast, {}, src); + }, +}; diff --git a/packages/e2e-test-app-fabric/index.js b/packages/e2e-test-app-fabric/index.js new file mode 100644 index 00000000000..4a72eedb391 --- /dev/null +++ b/packages/e2e-test-app-fabric/index.js @@ -0,0 +1 @@ +require('@react-native-windows/tester/js/RNTesterApp'); diff --git a/packages/e2e-test-app-fabric/jest.config.js b/packages/e2e-test-app-fabric/jest.config.js new file mode 100644 index 00000000000..06d65f81854 --- /dev/null +++ b/packages/e2e-test-app-fabric/jest.config.js @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * @format + * @ts-check + */ + +// For a detailed explanation regarding each configuration property, visit: +// https://jestjs.io/docs/en/configuration.html + +const assetTransform = 'react-native-windows/jest/assetFileTransformer.js'; +const reactNativeTransform = './custom-transformer.js'; +const defaultTransform = [ + 'babel-jest', + require('@rnw-scripts/babel-node-config'), +]; + +module.exports = { + preset: '@rnx-kit/jest-preset', + + // A list of paths to directories that Jest should use to search for files in + roots: ['/test/'], + + // The test environment that will be used for testing + testEnvironment: '@react-native-windows/automation', + + // The pattern or patterns Jest uses to detect test files + testRegex: '.*\\.test\\.ts$', + + // Default timeout of a test in milliseconds + testTimeout: 70000, + + // A map from regular expressions to paths to transformers + transform: { + '^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$': assetTransform, + 'node_modules\\\\@?react-native\\\\.*': reactNativeTransform, + '@react-native-windows\\\\tester\\\\.*': reactNativeTransform, + 'vnext\\\\.*': reactNativeTransform, + '^.+\\.[jt]sx?$': defaultTransform, + }, + + snapshotResolver: 'react-native-windows/jest-snapshot-resolver.js', + + // An array of regexp pattern strings that are matched against all source file paths before transformation. + // If the file path matches any of the patterns, it will not be transformed. + transformIgnorePatterns: ['jest-runner'], + + // Specifies the maximum number of workers the worker-pool will spawn for running tests. + maxWorkers: 1, + + // Indicates whether each individual test should be reported during the run. + verbose: true, + + // A list of paths to modules that run some code to configure or set up the testing framework + // before each test file in the suite is executed + setupFilesAfterEnv: ['react-native-windows/jest/setup', './jest.setup.js'], + + testEnvironmentOptions: { + app: 'RNTesterApp', + enableAutomationChannel: true, + }, +}; diff --git a/packages/e2e-test-app-fabric/jest.debug.config.js b/packages/e2e-test-app-fabric/jest.debug.config.js new file mode 100644 index 00000000000..6da3e0cfd70 --- /dev/null +++ b/packages/e2e-test-app-fabric/jest.debug.config.js @@ -0,0 +1,12 @@ +/** + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * @format + * @ts-check + */ + +const config = require('./jest.config'); + +config.testEnvironmentOptions.breakOnStart = true; +module.exports = config; diff --git a/packages/e2e-test-app-fabric/jest.setup.js b/packages/e2e-test-app-fabric/jest.setup.js new file mode 100644 index 00000000000..a2141d74c08 --- /dev/null +++ b/packages/e2e-test-app-fabric/jest.setup.js @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * @format + * @ts-check + */ + +const fs = require('fs'); +const path = require('path'); +const sanitizeFilename = require('sanitize-filename'); +const {LogBox} = require('react-native'); + +const screenshotDir = './errorShots'; +fs.mkdirSync(screenshotDir, {recursive: true}); + +LogBox.ignoreAllLogs(true); diff --git a/packages/e2e-test-app-fabric/just-task.js b/packages/e2e-test-app-fabric/just-task.js new file mode 100644 index 00000000000..32d6dab6999 --- /dev/null +++ b/packages/e2e-test-app-fabric/just-task.js @@ -0,0 +1,2 @@ + +require('@rnw-scripts/just-task'); diff --git a/packages/e2e-test-app-fabric/metro.config.js b/packages/e2e-test-app-fabric/metro.config.js new file mode 100644 index 00000000000..20cb8f39628 --- /dev/null +++ b/packages/e2e-test-app-fabric/metro.config.js @@ -0,0 +1,153 @@ +const {makeMetroConfig} = require('@rnw-scripts/metro-dev-config'); + +/** + * Metro configuration for React Native + * https://github.com/facebook/react-native + * + * @format + */ +const fs = require('fs'); +const path = require('path'); + +const rnwPath = fs.realpathSync( + path.dirname(require.resolve('react-native-windows/package.json')), +); +console.log(rnwPath); + +const rnwTesterPath = fs.realpathSync( + path.dirname(require.resolve('@react-native-windows/tester/package.json')), +); +console.log(rnwTesterPath); + +const devPackages = { + 'react-native': path.normalize(rnwPath), + 'react-native-windows': path.normalize(rnwPath), + '@react-native-windows/tester': path.normalize(rnwTesterPath), +}; + +function isRelativeImport(filePath) { + return /^[.][.]?(?:[/]|$)/.test(filePath); +} + +// Example: devResolve('C:/Repos/react-native-windows/vnext/', './Libraries/Text/Text'); +// Returns a full path to the resolved location which would be in the src subdirectory if +// the file exists or the directory root otherwise +function devResolve(packageName, originDir, moduleName) { + const originDirSrc = originDir.replace( + devPackages[packageName], + path.join(devPackages[packageName], 'src'), + ); + + // redirect the resolution to src if an appropriate file exists there + const extensions = [ + '', + '.windows.tsx', + '.windows.ts', + '.windows.jsx', + '.windows.js', + '.tsx', + '.ts', + '.jsx', + '.js', + ]; + + // For each potential extension we need to check for the file in either src and root + for (const extension of extensions) { + // Start with the src folder + let potentialSrcModuleName = path.resolve(originDirSrc, moduleName); + if (fs.existsSync(potentialSrcModuleName) && + fs.statSync(potentialSrcModuleName).isDirectory()) { + potentialSrcModuleName = path.resolve(potentialSrcModuleName, 'index'); + } + potentialSrcModuleName += extension; + + if (fs.existsSync(potentialSrcModuleName)) { + return potentialSrcModuleName; + } + + // Next check under root folder + let potentialModuleName = path.resolve(originDir, moduleName); + if (fs.existsSync(potentialModuleName) && + fs.statSync(potentialModuleName).isDirectory()) { + potentialModuleName = path.resolve(potentialModuleName, 'index'); + } + potentialModuleName += extension; + + if (fs.existsSync(potentialModuleName)) { + return potentialModuleName; + } + } +} + +/** + * Allows the usage of live reload in packages in our repo which merges + * Windows-specific over core. These normally work by copying from the "src" + * subdirectory to package root during build time, but this resolver will + * instead prefere the copy in "src" to avoid the need to build. + */ +function devResolveRequest( + context, + moduleName /* string */, + platform /* string */, +) { + const modifiedModuleName = + tryResolveDevPackage(moduleName) || + tryResolveDevAbsoluteImport(moduleName) || + tryResolveDevRelativeImport(context.originModulePath, moduleName) || + moduleName; + return context.resolveRequest(context, modifiedModuleName, platform); +} + +function tryResolveDevPackage(moduleName) /*: string | null*/ { + if (devPackages[moduleName]) { + return devResolve(moduleName, devPackages[moduleName], './index'); + } + + return null; +} + +function tryResolveDevAbsoluteImport(moduleName) /*: string | null*/ { + for (const [packageName, packagePath] of Object.entries(devPackages)) { + if (moduleName.startsWith(`${packageName}/`)) { + return devResolve( + packageName, + packagePath, + `./${moduleName.slice(`${packageName}/`.length)}`, + ); + } + } + + return null; +} + +function tryResolveDevRelativeImport( + originModulePath, + moduleName, +) /*: string | null*/ { + for (const [packageName, packagePath] of Object.entries(devPackages)) { + if ( + isRelativeImport(moduleName) && + originModulePath.startsWith(packagePath) + ) { + const packageSrcPath = path.join(packagePath, 'src'); + const originPathWithoutSrc = originModulePath.replace( + packageSrcPath, + packagePath, + ); + + return devResolve( + packageName, + path.dirname(originPathWithoutSrc), + moduleName, + ); + } + } + + return null; +} + +module.exports = makeMetroConfig({ + resolver: { + resolveRequest: devResolveRequest, + }, +}); diff --git a/packages/e2e-test-app-fabric/package.json b/packages/e2e-test-app-fabric/package.json new file mode 100644 index 00000000000..d1f241bcc20 --- /dev/null +++ b/packages/e2e-test-app-fabric/package.json @@ -0,0 +1,54 @@ +{ + "name": "e2e-test-app-fabric", + "version": "0.0.0", + "private": true, + "scripts": { + "start": "react-native start", + "lint": "rnw-scripts lint", + "lint:fix": "rnw-scripts lint:fix", + "watch": "rnw-scripts watch", + "windows": "react-native run-windows", + "e2etest": "jest", + "e2etest:updateSnapshots": "jest -u", + "e2etest:debug": "jest --config ./jest.debug.config.js" + }, + "dependencies": { + "@react-native-windows/automation-channel": "^0.10.0", + "@react-native-windows/tester": "0.0.1", + "@typescript-eslint/eslint-plugin": "^5.21.0", + "@typescript-eslint/parser": "^5.21.0", + "react": "18.2.0", + "react-native": "0.0.0-20230308-2111-d41e95fb1", + "react-native-windows": "^0.0.0-canary.631" + }, + "devDependencies": { + "@babel/core": "^7.20.0", + "@babel/generator": "^7.20.0", + "@babel/preset-env": "^7.8.4", + "@babel/preset-typescript": "^7.8.3", + "@babel/runtime": "^7.8.4", + "@react-native-windows/automation": "^0.3.52", + "@react-native-windows/automation-commands": "^0.1.72", + "@rnw-scripts/babel-node-config": "2.2.1", + "@rnw-scripts/babel-react-native-config": "0.0.0", + "@rnw-scripts/eslint-config": "1.1.15", + "@rnw-scripts/just-task": "2.3.6", + "@rnw-scripts/metro-dev-config": "0.0.0", + "@rnw-scripts/ts-config": "2.0.3", + "@rnx-kit/jest-preset": "^0.1.0", + "@types/jest": "^29.2.2", + "@types/node": "^14.14.22", + "@types/react": "^18.0.18", + "babel-jest": "^29.3.0", + "eslint": "^8.19.0", + "jest": "^29.2.1", + "metro-react-native-babel-transformer": "0.73.7", + "prettier": "^2.4.1", + "react-test-renderer": "18.2.0", + "sanitize-filename": "^1.6.3", + "typescript": "^4.9.5" + }, + "engines": { + "node": ">= 14" + } +} \ No newline at end of file diff --git a/packages/e2e-test-app-fabric/react-native.config.js b/packages/e2e-test-app-fabric/react-native.config.js new file mode 100644 index 00000000000..325522a89e4 --- /dev/null +++ b/packages/e2e-test-app-fabric/react-native.config.js @@ -0,0 +1,11 @@ +module.exports = { + project: { + windows: { + sourceDir: 'windows', + solutionFile: 'RNTesterApp-Fabric.sln', + project: { + projectFile: 'RNTesterApp-Fabric\\RNTesterApp-Fabric.vcxproj', + }, + }, + }, +}; diff --git a/packages/e2e-test-app-fabric/tsconfig.json b/packages/e2e-test-app-fabric/tsconfig.json new file mode 100644 index 00000000000..3dd4a07382c --- /dev/null +++ b/packages/e2e-test-app-fabric/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@rnw-scripts/ts-config", + "compilerOptions": { + "types": ["jest"] + }, + "include": [ + "app", + "test", "index.ts", + ], + "exclude": [ + "node_modules" + ] +} diff --git a/packages/e2e-test-app-fabric/windows/ExperimentalFeatures.props b/packages/e2e-test-app-fabric/windows/ExperimentalFeatures.props new file mode 100644 index 00000000000..4fffc374831 --- /dev/null +++ b/packages/e2e-test-app-fabric/windows/ExperimentalFeatures.props @@ -0,0 +1,21 @@ + + + + + true + true + false + + true + + + + + 2.7.0-prerelease.210913003 + + + diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric.sln b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric.sln new file mode 100644 index 00000000000..86f1e9225ef --- /dev/null +++ b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric.sln @@ -0,0 +1,148 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33414.496 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RNTesterApp-Fabric", "RNTesterApp-Fabric\RNTesterApp-Fabric.vcxproj", "{3719BE61-52D1-4F42-8A4C-E575BA16E65F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReactNative", "ReactNative", "{229CEDD5-5608-40BB-9A11-5AE25468BAB3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra", "..\..\..\vnext\Chakra\Chakra.vcxitems", "{C38970C0-5FBF-4D69-90D8-CBAC225AE895}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "..\..\..\vnext\Common\Common.vcxproj", "{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Folly", "..\..\..\vnext\Folly\Folly.vcxproj", "{A990658C-CE31-4BCC-976F-0FC6B1AF693D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmt", "..\..\..\vnext\fmt\fmt.vcxproj", "{14B93DC8-FD93-4A6D-81CB-8BC96644501C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative", "..\..\..\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj", "{F7D32BD0-2749-483E-9A0D-1635EF7E3136}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mso", "..\..\..\vnext\Mso\Mso.vcxitems", "{84E05BFA-CBAF-4F0D-BFB6-4CE85742A57E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative.Cxx", "..\..\..\vnext\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems", "{DA8B35B3-DA00-4B02-BDE6-6A397B3FD46B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative.Shared", "..\..\..\vnext\Shared\Shared.vcxitems", "{2049DBE9-8D13-42C9-AE4B-413AE38FFFD0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactCommon", "..\..\..\vnext\ReactCommon\ReactCommon.vcxproj", "{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3719BE61-52D1-4F42-8A4C-E575BA16E65F}.Debug|ARM64.ActiveCfg = Debug|x64 + {3719BE61-52D1-4F42-8A4C-E575BA16E65F}.Debug|ARM64.Build.0 = Debug|x64 + {3719BE61-52D1-4F42-8A4C-E575BA16E65F}.Debug|x64.ActiveCfg = Debug|x64 + {3719BE61-52D1-4F42-8A4C-E575BA16E65F}.Debug|x64.Build.0 = Debug|x64 + {3719BE61-52D1-4F42-8A4C-E575BA16E65F}.Debug|x86.ActiveCfg = Debug|Win32 + {3719BE61-52D1-4F42-8A4C-E575BA16E65F}.Debug|x86.Build.0 = Debug|Win32 + {3719BE61-52D1-4F42-8A4C-E575BA16E65F}.Release|ARM64.ActiveCfg = Release|x64 + {3719BE61-52D1-4F42-8A4C-E575BA16E65F}.Release|ARM64.Build.0 = Release|x64 + {3719BE61-52D1-4F42-8A4C-E575BA16E65F}.Release|x64.ActiveCfg = Release|x64 + {3719BE61-52D1-4F42-8A4C-E575BA16E65F}.Release|x64.Build.0 = Release|x64 + {3719BE61-52D1-4F42-8A4C-E575BA16E65F}.Release|x86.ActiveCfg = Release|Win32 + {3719BE61-52D1-4F42-8A4C-E575BA16E65F}.Release|x86.Build.0 = Release|Win32 + {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM64.Build.0 = Debug|ARM64 + {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x64.ActiveCfg = Debug|x64 + {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x64.Build.0 = Debug|x64 + {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x86.ActiveCfg = Debug|Win32 + {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x86.Build.0 = Debug|Win32 + {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x86.Deploy.0 = Debug|Win32 + {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM64.ActiveCfg = Release|ARM64 + {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM64.Build.0 = Release|ARM64 + {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x64.ActiveCfg = Release|x64 + {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x64.Build.0 = Release|x64 + {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.ActiveCfg = Release|Win32 + {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.Build.0 = Release|Win32 + {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.Deploy.0 = Release|Win32 + {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM64.Build.0 = Debug|ARM64 + {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x64.ActiveCfg = Debug|x64 + {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x64.Build.0 = Debug|x64 + {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x86.ActiveCfg = Debug|Win32 + {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x86.Build.0 = Debug|Win32 + {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x86.Deploy.0 = Debug|Win32 + {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM64.ActiveCfg = Release|ARM64 + {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM64.Build.0 = Release|ARM64 + {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x64.ActiveCfg = Release|x64 + {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x64.Build.0 = Release|x64 + {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.ActiveCfg = Release|Win32 + {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.Build.0 = Release|Win32 + {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.Deploy.0 = Release|Win32 + {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|ARM64.Build.0 = Debug|ARM64 + {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x64.ActiveCfg = Debug|x64 + {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x64.Build.0 = Debug|x64 + {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x86.ActiveCfg = Debug|Win32 + {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x86.Build.0 = Debug|Win32 + {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x86.Deploy.0 = Debug|Win32 + {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|ARM64.ActiveCfg = Release|ARM64 + {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|ARM64.Build.0 = Release|ARM64 + {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x64.ActiveCfg = Release|x64 + {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x64.Build.0 = Release|x64 + {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x86.ActiveCfg = Release|Win32 + {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x86.Build.0 = Release|Win32 + {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x86.Deploy.0 = Release|Win32 + {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM64.Build.0 = Debug|ARM64 + {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x64.ActiveCfg = Debug|x64 + {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x64.Build.0 = Debug|x64 + {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.ActiveCfg = Debug|Win32 + {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.Build.0 = Debug|Win32 + {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.Deploy.0 = Debug|Win32 + {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM64.ActiveCfg = Release|ARM64 + {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM64.Build.0 = Release|ARM64 + {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x64.ActiveCfg = Release|x64 + {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x64.Build.0 = Release|x64 + {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.ActiveCfg = Release|Win32 + {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.Build.0 = Release|Win32 + {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.Deploy.0 = Release|Win32 + {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM64.Build.0 = Debug|ARM64 + {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x64.ActiveCfg = Debug|x64 + {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x64.Build.0 = Debug|x64 + {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x86.ActiveCfg = Debug|Win32 + {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x86.Build.0 = Debug|Win32 + {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x86.Deploy.0 = Debug|Win32 + {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM64.ActiveCfg = Release|ARM64 + {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM64.Build.0 = Release|ARM64 + {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x64.ActiveCfg = Release|x64 + {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x64.Build.0 = Release|x64 + {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x86.ActiveCfg = Release|Win32 + {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x86.Build.0 = Release|Win32 + {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x86.Deploy.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {C38970C0-5FBF-4D69-90D8-CBAC225AE895} = {229CEDD5-5608-40BB-9A11-5AE25468BAB3} + {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D} = {229CEDD5-5608-40BB-9A11-5AE25468BAB3} + {A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {229CEDD5-5608-40BB-9A11-5AE25468BAB3} + {14B93DC8-FD93-4A6D-81CB-8BC96644501C} = {229CEDD5-5608-40BB-9A11-5AE25468BAB3} + {F7D32BD0-2749-483E-9A0D-1635EF7E3136} = {229CEDD5-5608-40BB-9A11-5AE25468BAB3} + {84E05BFA-CBAF-4F0D-BFB6-4CE85742A57E} = {229CEDD5-5608-40BB-9A11-5AE25468BAB3} + {DA8B35B3-DA00-4B02-BDE6-6A397B3FD46B} = {229CEDD5-5608-40BB-9A11-5AE25468BAB3} + {2049DBE9-8D13-42C9-AE4B-413AE38FFFD0} = {229CEDD5-5608-40BB-9A11-5AE25468BAB3} + {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD} = {229CEDD5-5608-40BB-9A11-5AE25468BAB3} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A9187620-797E-4EC0-B739-B58FF4C12BF3} + EndGlobalSection + GlobalSection(SharedMSBuildProjectFiles) = preSolution + ..\..\..\vnext\Shared\Shared.vcxitems*{2049dbe9-8d13-42c9-ae4b-413ae38fffd0}*SharedItemsImports = 9 + ..\..\..\vnext\Mso\Mso.vcxitems*{84e05bfa-cbaf-4f0d-bfb6-4ce85742a57e}*SharedItemsImports = 9 + ..\..\..\vnext\Chakra\Chakra.vcxitems*{c38970c0-5fbf-4d69-90d8-cbac225ae895}*SharedItemsImports = 9 + ..\..\..\vnext\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{da8b35b3-da00-4b02-bde6-6a397b3fd46b}*SharedItemsImports = 9 + ..\..\..\vnext\Chakra\Chakra.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 + ..\..\..\vnext\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 + ..\..\..\vnext\Mso\Mso.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 + ..\..\..\vnext\Shared\Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4 + EndGlobalSection +EndGlobal diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp new file mode 100644 index 00000000000..6597293233e --- /dev/null +++ b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.cpp @@ -0,0 +1,276 @@ +// RNTesterApp-Fabric.cpp : Defines the entry point for the application. +// + +#include "pch.h" +#include "RNTesterApp-Fabric.h" + +#include "../../../../vnext/codegen/NativeDeviceInfoSpec.g.h" + +#include +#include + +#include +#include + +#include "NativeModules.h" +#include "ReactPropertyBag.h" + +constexpr size_t MAX_LOADSTRING = 100; + +// Work around crash in DeviceInfo when running outside of XAML environment +// TODO rework built-in DeviceInfo to allow it to be driven without use of HWNDs or XamlApps +// Issue Tracking #11414 +REACT_MODULE(DeviceInfo) +struct DeviceInfo { + using ModuleSpec = Microsoft::ReactNativeSpecs::DeviceInfoSpec; + + REACT_INIT(Initialize) + void Initialize(React::ReactContext const &reactContext) noexcept { + m_context = reactContext; + } + + REACT_GET_CONSTANTS(GetConstants) + Microsoft::ReactNativeSpecs::DeviceInfoSpec_Constants GetConstants() noexcept { + Microsoft::ReactNativeSpecs::DeviceInfoSpec_Constants constants; + Microsoft::ReactNativeSpecs::DeviceInfoSpec_DisplayMetrics screenDisplayMetrics; + screenDisplayMetrics.fontScale = 1; + screenDisplayMetrics.height = 1024; + screenDisplayMetrics.width = 1024; + screenDisplayMetrics.scale = 1; + constants.Dimensions.screen = screenDisplayMetrics; + constants.Dimensions.window = screenDisplayMetrics; + return constants; + } + + private: + winrt::Microsoft::ReactNative::ReactContext m_context; +}; + +// Have to use TurboModules to override built in modules.. so the standard attributed package provider doesn't work. +struct CompReactPackageProvider + : winrt::implements { + public: // IReactPackageProvider + void CreatePackage(winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder) noexcept { + AddAttributedModules(packageBuilder, true); + packageBuilder.AddModule(L"DeviceInfo", winrt::Microsoft::ReactNative::MakeTurboModuleProvider()); + } +}; + +// Global Variables: +WCHAR szTitle[MAX_LOADSTRING]; // The title bar text +WCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name + +winrt::Windows::System::DispatcherQueueController g_dispatcherQueueController{nullptr}; +winrt::Windows::UI::Composition::Compositor g_compositor{nullptr}; + +constexpr auto WindowDataProperty = L"WindowData"; +constexpr PCWSTR c_windowClassName = L"MS_REACTNATIVE_RNTESTER_COMPOSITION"; +constexpr PCWSTR appName = L"RNTesterApp"; + +// Forward declarations of functions included in this code module: +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); +int RunRNTester(int showCmd); + +struct WindowData { + static HINSTANCE s_instance; + static constexpr uint16_t defaultDebuggerPort{9229}; + + std::wstring m_bundleFile = L"index"; + bool m_windowInited{false}; + winrt::Microsoft::ReactNative::CompositionHwndHost m_CompositionHwndHost{nullptr}; + winrt::Microsoft::ReactNative::ReactNativeHost m_host{nullptr}; + winrt::Microsoft::ReactNative::ReactInstanceSettings m_instanceSettings{nullptr}; + + bool m_useWebDebugger{false}; + bool m_fastRefreshEnabled{true}; + bool m_useDirectDebugger{false}; + bool m_breakOnNextLine{false}; + uint16_t m_debuggerPort{defaultDebuggerPort}; + xaml::ElementTheme m_theme{xaml::ElementTheme::Default}; + + WindowData(const winrt::Microsoft::ReactNative::CompositionHwndHost &compHost) : m_CompositionHwndHost(compHost) { + winrt::Microsoft::ReactNative::Composition::CompositionUIService::SetCompositionContext( + InstanceSettings().Properties(), + winrt::Microsoft::ReactNative::Composition::CompositionContextHelper::CreateContext(g_compositor)); + } + + static WindowData *GetFromWindow(HWND hwnd) { + auto data = reinterpret_cast(GetProp(hwnd, WindowDataProperty)); + return data; + } + + winrt::Microsoft::ReactNative::ReactNativeHost Host() noexcept { + if (!m_host) { + m_host = winrt::Microsoft::ReactNative::ReactNativeHost(); + m_host.InstanceSettings(InstanceSettings()); + } + + return m_host; + } + + winrt::Microsoft::ReactNative::ReactInstanceSettings InstanceSettings() noexcept { + if (!m_instanceSettings) { + m_instanceSettings = winrt::Microsoft::ReactNative::ReactInstanceSettings(); + } + + return m_instanceSettings; + } + + LRESULT RenderApp(HWND hwnd) { + WCHAR workingDir[MAX_PATH]; + GetCurrentDirectory(MAX_PATH, workingDir); + + auto host = Host(); + // Disable until we have a 3rd party story for custom components + // RegisterAutolinkedNativeModulePackages(host.PackageProviders()); // Includes any + // autolinked modules + + host.InstanceSettings().JavaScriptBundleFile(m_bundleFile); + + host.InstanceSettings().UseWebDebugger(m_useWebDebugger); + host.InstanceSettings().UseDirectDebugger(m_useDirectDebugger); + host.InstanceSettings().BundleRootPath(std::wstring(L"file:").append(workingDir).append(L"\\Bundle\\").c_str()); + host.InstanceSettings().DebuggerBreakOnNextLine(m_breakOnNextLine); + host.InstanceSettings().UseFastRefresh(m_fastRefreshEnabled); + host.InstanceSettings().DebuggerPort(m_debuggerPort); + host.InstanceSettings().UseDeveloperSupport(true); + + host.PackageProviders().Append(winrt::make()); + winrt::Microsoft::ReactNative::ReactCoreInjection::SetTopLevelWindowId( + host.InstanceSettings().Properties(), reinterpret_cast(hwnd)); + + // Nudge the ReactNativeHost to create the instance and wrapping context + host.ReloadInstance(); + + winrt::Microsoft::ReactNative::ReactViewOptions viewOptions; + viewOptions.ComponentName(appName); + m_CompositionHwndHost.ReactViewHost( + winrt::Microsoft::ReactNative::ReactCoreInjection::MakeViewHost(host, viewOptions)); + + auto windowData = WindowData::GetFromWindow(hwnd); + if (!windowData->m_windowInited) { + m_CompositionHwndHost.Initialize((uint64_t)(hwnd)); + windowData->m_windowInited = true; + } + return 0; + } + + LRESULT TranslateMessage(UINT message, WPARAM wparam, LPARAM lparam) noexcept { + if (m_CompositionHwndHost) { + return static_cast(m_CompositionHwndHost.TranslateMessage(message, wparam, lparam)); + } + return 0; + } +}; + +extern "C" IMAGE_DOS_HEADER __ImageBase; +HINSTANCE WindowData::s_instance = reinterpret_cast(&__ImageBase); + +LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { + auto windowData = WindowData::GetFromWindow(hWnd); + if (windowData) { + auto result = WindowData::GetFromWindow(hWnd)->TranslateMessage(message, wParam, lParam); + if (result) + return result; + } + + switch (message) { + case WM_DESTROY: { + delete WindowData::GetFromWindow(hWnd); + SetProp(hWnd, WindowDataProperty, 0); + PostQuitMessage(0); + return 0; + } + case WM_NCCREATE: { + auto cs = reinterpret_cast(lParam); + auto windowData = static_cast(cs->lpCreateParams); + WINRT_ASSERT(windowData); + SetProp(hWnd, WindowDataProperty, reinterpret_cast(windowData)); + break; + } + case WM_GETOBJECT: { + if (lParam == UiaRootObjectId) { + auto windowData = WindowData::GetFromWindow(hWnd); + if (!windowData->m_windowInited) + break; + + auto hwndHost = windowData->m_CompositionHwndHost; + winrt::com_ptr spReps; + hwndHost.UiaProvider().as(spReps); + LRESULT lResult = UiaReturnRawElementProvider(hWnd, wParam, lParam, spReps.get()); + return lResult; + } + } + } + + return DefWindowProc(hWnd, message, wParam, lParam); +} + +int RunRNTester(int showCmd) { + auto windowData = std::make_unique(winrt::Microsoft::ReactNative::CompositionHwndHost()); + HWND hwnd = CreateWindow( + c_windowClassName, + appName, + WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + nullptr, + nullptr, + WindowData::s_instance, + windowData.get()); + + WINRT_VERIFY(hwnd); + + windowData.release(); + + ShowWindow(hwnd, showCmd); + UpdateWindow(hwnd); + SetFocus(hwnd); + WindowData::GetFromWindow(hwnd)->RenderApp(hwnd); + + HACCEL hAccelTable = LoadAccelerators(WindowData::s_instance, MAKEINTRESOURCE(IDC_RNTESTER_COMPOSITION)); + + MSG msg = {}; + while (GetMessage(&msg, nullptr, 0, 0)) { + if (!TranslateAccelerator(hwnd, hAccelTable, &msg)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + return static_cast(msg.wParam); +} + +_Use_decl_annotations_ int CALLBACK WinMain(HINSTANCE instance, HINSTANCE, PSTR /* commandLine */, int showCmd) { + WNDCLASSEXW wcex = {}; + wcex.cbSize = sizeof(WNDCLASSEX); + wcex.style = CS_HREDRAW | CS_VREDRAW; + wcex.lpfnWndProc = &WndProc; + wcex.cbClsExtra = DLGWINDOWEXTRA; + wcex.cbWndExtra = sizeof(WindowData *); + wcex.hInstance = WindowData::s_instance; + wcex.hCursor = LoadCursor(nullptr, IDC_ARROW); + wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); + wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_RNTESTER_COMPOSITION); + wcex.lpszClassName = c_windowClassName; + wcex.hIcon = LoadIconW(instance, MAKEINTRESOURCEW(IDI_ICON1)); + ATOM classId = RegisterClassEx(&wcex); + WINRT_VERIFY(classId); + winrt::check_win32(!classId); + + DispatcherQueueOptions options{ + sizeof(DispatcherQueueOptions), /* dwSize */ + DQTYPE_THREAD_CURRENT, /* threadType */ + DQTAT_COM_ASTA /* apartmentType */ + }; + + // Need to have a Dispatcher on the current thread to be able to create a Compositor + winrt::check_hresult(CreateDispatcherQueueController( + options, + reinterpret_cast( + winrt::put_abi(g_dispatcherQueueController)))); + + g_compositor = winrt::Windows::UI::Composition::Compositor(); + return RunRNTester(showCmd); +} diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.h b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.h new file mode 100644 index 00000000000..d00d47e7885 --- /dev/null +++ b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.h @@ -0,0 +1,3 @@ +#pragma once + +#include "resource.h" diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.ico b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.ico new file mode 100644 index 00000000000..b3ec03bd617 Binary files /dev/null and b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.ico differ diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.rc b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.rc new file mode 100644 index 00000000000..5c3e4acd8c9 Binary files /dev/null and b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.rc differ diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.vcxproj b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.vcxproj new file mode 100644 index 00000000000..9018d1bb954 --- /dev/null +++ b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.vcxproj @@ -0,0 +1,142 @@ + + + + + true + true + {3719BE61-52D1-4F42-8A4C-E575BA16E65F} + RNTesterApp-Fabric + Win32Proj + RNTesterApp + 10.0 + en-US + 17.0 + false + + + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\ + + false + + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + Application + true + v143 + Unicode + + + Application + Unicode + v143 + + + true + + + false + true + + + + + + + + + + + + + + Use + pch.h + $(IntDir)pch.pch + Level3 + true + %(AdditionalOptions) /bigobj + 4453;28204 + + + shell32.lib;user32.lib;windowsapp.lib;%(AdditionalDependenices) + Windows + true + + + + + _DEBUG;%(PreprocessorDefinitions) + + + + + NDEBUG;%(PreprocessorDefinitions) + + + + + USE_FABRIC;%(PreprocessorDefinitions) + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + This project references targets in your node_modules\react-native-windows folder. The missing file is {0}. + + + + + \ No newline at end of file diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.vcxproj.filters b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.vcxproj.filters new file mode 100644 index 00000000000..0098bfd42f4 --- /dev/null +++ b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/RNTesterApp-Fabric.vcxproj.filters @@ -0,0 +1,55 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + + + Resource Files + + + + + Resource Files + + + Resource Files + + + + + + \ No newline at end of file diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/pch.cpp b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/pch.cpp new file mode 100644 index 00000000000..1d9f38c57d6 --- /dev/null +++ b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/pch.h b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/pch.h new file mode 100644 index 00000000000..8512a671430 --- /dev/null +++ b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/pch.h @@ -0,0 +1,35 @@ +// pch.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define NOMINMAX 1 +#define WIN32_LEAN_AND_MEAN 1 +#define WINRT_LEAN_AND_MEAN 1 + +// Windows Header Files +#include + +#pragma push_macro("GetCurrentTime") +#undef GetCurrentTime + +// Playground pch.h +#include +#include +#include +#include +#pragma pop_macro("GetCurrentTime") + +// C RunTime Header Files +#include +#include +#include +#include + +// reference additional headers your program requires here +#include +#include diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/resource.h b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/resource.h new file mode 100644 index 00000000000..23aedb3508d --- /dev/null +++ b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/resource.h @@ -0,0 +1,18 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by RNTesterApp-Fabric.rc + +#define IDC_RNTESTER_COMPOSITION 100 +#define IDI_ICON1 1008 +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS + +#define _APS_NO_MFC 130 +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 110 +#endif +#endif diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/small.ico b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/small.ico new file mode 100644 index 00000000000..b3ec03bd617 Binary files /dev/null and b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/small.ico differ diff --git a/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/targetver.h b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/targetver.h new file mode 100644 index 00000000000..87c0086de75 --- /dev/null +++ b/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include