diff --git a/gulpfile.js b/gulpfile.js index 2dcb017e1..e18e28425 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -183,9 +183,8 @@ gulp.task("clean", () => { "!test/resources/sampleReactNative022Project/**/*.js", ".vscode-test/", "nls.*.json", - "!test/smoke/resources/ReactNativeSample/App.js", - "!test/smoke/resources/ExpoSample/App.js", - "!test/smoke/resources/PureRNExpoSample/App.js", + "!test/smoke/**/*.js", + "!test/smoke/**/*.js.map", ] return del(pathsToDelete, { force: true }); }); diff --git a/package.json b/package.json index 3584e966d..dbb44da92 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ ], "activationEvents": [ "onDebugResolve:reactnative", + "onDebugResolve:reactnativedirect", "onDebugInitialConfigurations", "onCommand:reactNative.runAndroidSimulator", "onCommand:reactNative.runAndroidDevice", diff --git a/test/smoke/resources/HermesReactNativeSample/App.js b/test/smoke/resources/HermesReactNativeSample/App.js new file mode 100644 index 000000000..50fe117f5 --- /dev/null +++ b/test/smoke/resources/HermesReactNativeSample/App.js @@ -0,0 +1,75 @@ +/** + * Sample React Native App + * https://github.com/facebook/react-native + * + * @format + * @flow + */ + +import React from 'react'; +import { SafeAreaView, StyleSheet, ScrollView, View, Text, StatusBar } from 'react-native'; +import { Header, LearnMoreLinks, Colors, DebugInstructions, ReloadInstructions } from 'react-native/Libraries/NewAppScreen'; +import AppTestButton from './AppTestButton'; + +const App: () => React$Node = () => { + console.log('Test output from debuggee'); + return ( + <> + + + +
+ {global.HermesInternal == null ? null : ( + + Engine: Hermes + + )} + + + + + ); +}; + +const styles = StyleSheet.create({ + scrollView: { + backgroundColor: Colors.lighter, + }, + engine: { + position: 'absolute', + right: 0, + }, + body: { + backgroundColor: Colors.white, + }, + sectionContainer: { + marginTop: 32, + paddingHorizontal: 24, + }, + sectionTitle: { + fontSize: 24, + fontWeight: '600', + color: Colors.black, + }, + sectionDescription: { + marginTop: 8, + fontSize: 18, + fontWeight: '400', + color: Colors.dark, + }, + highlight: { + fontWeight: '700', + }, + footer: { + color: Colors.dark, + fontSize: 12, + fontWeight: '600', + padding: 4, + paddingRight: 12, + textAlign: 'right', + }, +}); + +export default App; diff --git a/test/smoke/resources/HermesReactNativeSample/AppTestButton.js b/test/smoke/resources/HermesReactNativeSample/AppTestButton.js new file mode 100644 index 000000000..d5c4a6bdb --- /dev/null +++ b/test/smoke/resources/HermesReactNativeSample/AppTestButton.js @@ -0,0 +1,25 @@ +import React, { Component } from 'react'; +import { View, Button } from 'react-native'; + +export default class AppTestButton extends Component { + constructor(props) { + super(props); + this.handleClick = this.handleClick.bind(this); + } + handleClick() { + let testBooleanValue = true; + console.log('Test output from Hermes debuggee'); + } + render() { + return ( + +