Skip to content
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
1 change: 1 addition & 0 deletions .circleci/configurations/test_workflows/testAndroid.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
tests_android:
when:
and:
- equal: [ true, false ] # Disable for visionOS
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
Expand Down
1 change: 1 addition & 0 deletions .circleci/configurations/test_workflows/testE2E.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
tests_e2e:
when:
and:
- equal: [ true, false ] # Disable for visionOS
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
Expand Down
1 change: 1 addition & 0 deletions .circleci/configurations/test_workflows/testIOS.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
test_ios:
when:
and:
- equal: [ true, false ] # Disable for visionOS
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
Expand Down
3 changes: 2 additions & 1 deletion .circleci/configurations/test_workflows/testJS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
- test_js:
name: test_js_prev_lts
executor: nodeprevlts
- test_windows
# Not needed for visionOS
# - test_windows
1 change: 1 addition & 0 deletions .circleci/configurations/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ workflows:
publish_bumped_packages:
when:
and:
- equal: [ 'https://github.com/facebook/react-native', << pipeline.project.git_url >> ]
- equal: [ false, << pipeline.parameters.run_release_workflow >> ]
- equal: [ false, << pipeline.parameters.run_nightly_workflow >> ]
jobs:
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/ios-tests.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
name: ios-tests


# on:
# push:
# branches:
# - main
# pull_request:
# branches:
# - "*"

# For visionOS we run iOS tests every night
on:
push:
branches:
- main
pull_request:
branches:
- "*"
schedule:
- cron: '0 0 * * *'

jobs:
test_ios_rntester-Hermes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import NativeEventEmitter from '../../EventEmitter/NativeEventEmitter';
import LayoutAnimation from '../../LayoutAnimation/LayoutAnimation';
import dismissKeyboard from '../../Utilities/dismissKeyboard';
import Platform from '../../Utilities/Platform';
import NativeKeyboardObserver from './NativeKeyboardObserver';
import warnOnce from '../../Utilities/warnOnce';
import NativeKeyboardObserver from './NativeKeyboardObserver';

export type KeyboardEventName = $Keys<KeyboardEventDefinitions>;

Expand Down Expand Up @@ -161,7 +161,7 @@ class Keyboard {
context?: mixed,
): EventSubscription {
if (Platform.isVisionOS) {
return;
return {remove() {}};
}

return this._emitter.addListener(eventType, listener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ exports[`<Pressable /> should render as expected: should deep render when mocked
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
visionos_hoverEffect="highlight"
>
<View />
</View>
Expand Down Expand Up @@ -67,6 +68,7 @@ exports[`<Pressable /> should render as expected: should deep render when not mo
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
visionos_hoverEffect="highlight"
>
<View />
</View>
Expand Down Expand Up @@ -115,6 +117,7 @@ exports[`<Pressable disabled={true} /> should be disabled when disabled is true:
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
visionos_hoverEffect="highlight"
>
<View />
</View>
Expand Down Expand Up @@ -151,6 +154,7 @@ exports[`<Pressable disabled={true} /> should be disabled when disabled is true:
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
visionos_hoverEffect="highlight"
>
<View />
</View>
Expand Down Expand Up @@ -203,6 +207,7 @@ exports[`<Pressable disabled={true} accessibilityState={{}} /> should be disable
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
visionos_hoverEffect="highlight"
>
<View />
</View>
Expand Down Expand Up @@ -239,6 +244,7 @@ exports[`<Pressable disabled={true} accessibilityState={{}} /> should be disable
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
visionos_hoverEffect="highlight"
>
<View />
</View>
Expand Down Expand Up @@ -293,6 +299,7 @@ exports[`<Pressable disabled={true} accessibilityState={{checked: true}} /> shou
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
visionos_hoverEffect="highlight"
>
<View />
</View>
Expand Down Expand Up @@ -329,6 +336,7 @@ exports[`<Pressable disabled={true} accessibilityState={{checked: true}} /> shou
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
visionos_hoverEffect="highlight"
>
<View />
</View>
Expand Down Expand Up @@ -391,6 +399,7 @@ exports[`<Pressable disabled={true} accessibilityState={{disabled: false}} /> sh
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
visionos_hoverEffect="highlight"
>
<View />
</View>
Expand Down Expand Up @@ -427,6 +436,7 @@ exports[`<Pressable disabled={true} accessibilityState={{disabled: false}} /> sh
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
visionos_hoverEffect="highlight"
>
<View />
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ exports[`TouchableOpacity renders correctly 1`] = `
"opacity": 1,
}
}
visionos_hoverEffect="highlight"
>
<Text>
Touchable
Expand Down Expand Up @@ -75,6 +76,7 @@ exports[`TouchableOpacity renders in disabled state when a disabled prop is pass
"opacity": 1,
}
}
visionos_hoverEffect="highlight"
>
<Text>
Touchable
Expand Down Expand Up @@ -116,6 +118,7 @@ exports[`TouchableOpacity renders in disabled state when a key disabled in acces
"opacity": 1,
}
}
visionos_hoverEffect="highlight"
>
<Text>
Touchable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ exports[`<Button /> should be disabled and it should set accessibilityState to d
"opacity": 1,
}
}
visionos_hoverEffect="highlight"
>
<View
style={
Expand Down Expand Up @@ -101,6 +102,7 @@ exports[`<Button /> should be disabled when disabled is empty and accessibilityS
"opacity": 1,
}
}
visionos_hoverEffect="highlight"
>
<View
style={
Expand Down Expand Up @@ -167,6 +169,7 @@ exports[`<Button /> should be disabled when disabled={true} and accessibilitySta
"opacity": 1,
}
}
visionos_hoverEffect="highlight"
>
<View
style={
Expand Down Expand Up @@ -234,6 +237,7 @@ exports[`<Button /> should be set importantForAccessibility={no-hide-descendants
"opacity": 1,
}
}
visionos_hoverEffect="highlight"
>
<View
style={
Expand Down Expand Up @@ -296,6 +300,7 @@ exports[`<Button /> should be set importantForAccessibility={no-hide-descendants
"opacity": 1,
}
}
visionos_hoverEffect="highlight"
>
<View
style={
Expand Down Expand Up @@ -357,6 +362,7 @@ exports[`<Button /> should not be disabled when disabled={false} and accessibili
"opacity": 1,
}
}
visionos_hoverEffect="highlight"
>
<View
style={
Expand Down Expand Up @@ -419,6 +425,7 @@ exports[`<Button /> should not be disabled when disabled={false} and accessibili
"opacity": 1,
}
}
visionos_hoverEffect="highlight"
>
<View
style={
Expand Down Expand Up @@ -481,6 +488,7 @@ exports[`<Button /> should overwrite accessibilityState with value of disabled p
"opacity": 1,
}
}
visionos_hoverEffect="highlight"
>
<View
style={
Expand Down Expand Up @@ -547,6 +555,7 @@ exports[`<Button /> should render as expected 1`] = `
"opacity": 1,
}
}
visionos_hoverEffect="highlight"
>
<View
style={
Expand Down
5 changes: 5 additions & 0 deletions packages/react-native/Libraries/Utilities/Platform.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ const Platform: PlatformType = {
return this.constants.isDisableAnimations ?? this.isTesting;
},
// $FlowFixMe[unsafe-getters-setters]
get isVisionOS(): boolean {
// $FlowFixMe[object-this-reference]
return this.constants.interfaceIdiom === 'vision';
},
// $FlowFixMe[unsafe-getters-setters]
get isTV(): boolean {
// $FlowFixMe[object-this-reference]
return this.constants.uiMode === 'tv';
Expand Down
2 changes: 2 additions & 0 deletions packages/react-native/Libraries/Utilities/Platform.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ type AndroidPlatform = {
Manufacturer: string,
|},
// $FlowFixMe[unsafe-getters-setters]
get isVisionOS(): boolean,
// $FlowFixMe[unsafe-getters-setters]
get isTV(): boolean,
// $FlowFixMe[unsafe-getters-setters]
get isTesting(): boolean,
Expand Down
19 changes: 18 additions & 1 deletion scripts/circleci/pipeline_selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,23 @@ function _computeAndSavePipelineParameters(
return;
}

// Custom config for visionOS
if (pipelineType === 'VISION_OS') {
const params = {
run_all: false,
run_ios: false,
run_android: false,
run_js: true,
run_e2e: false,
};

const stringifiedParams = JSON.stringify(params, null, 2);
fs.writeFileSync(filePath, stringifiedParams);
console.info(`Generated params:\n${stringifiedParams}`);

return;
}

console.log(`Should run e2e? ${shouldRunE2E}`);
if (pipelineType === 'ALL') {
fs.writeFileSync(
Expand Down Expand Up @@ -243,5 +260,5 @@ function filterJobs(outputPath) {
return;
}
}
_computeAndSavePipelineParameters('ALL', outputPath, shouldRunE2E);
_computeAndSavePipelineParameters('VISION_OS', outputPath, shouldRunE2E);
}