-
Notifications
You must be signed in to change notification settings - Fork 58
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
Use Hermes bytecode on Android #2780
Conversation
Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job! |
Just noting that since these changes result in new |
Not premature at all, thanks for the comment @mchowning! Not sure though, since we are not keeping the bundle files under source control anymore, what do you mean by generating and adding those files to this PR? For what is worth, I already added them to .gitignore, same as the non |
I forgot that we're not committing the files anymore. Adding them to .gitignore is perfect. 👍 |
ee4c1b0
to
fd80fe6
Compare
I rebased this PR to remove the GB updates that are by now merged into develop anyway and are not related to this PR. |
"test:e2e:bundle:android": "mkdir -p gutenberg/packages/react-native-editor/android/app/src/main/assets && npm run rn-bundle -- --reset-cache --platform android --dev false --minify false --entry-file index.js --bundle-output gutenberg/packages/react-native-editor/android/app/src/main/assets/index.android.bundle --assets-dest gutenberg/packages/react-native-editor/android/app/src/main/res", | ||
"test:e2e:bundle:android": "npm run test:e2e:bundle:android:text && npm run test:e2e:bundle:android:bytecode", | ||
"test:e2e:bundle:android:text": "mkdir -p gutenberg/packages/react-native-editor/android/app/src/main/assets && npm run rn-bundle -- --reset-cache --platform android --dev false --minify false --entry-file index.js --bundle-output gutenberg/packages/react-native-editor/android/app/src/main/assets/index.android.text.bundle --assets-dest gutenberg/packages/react-native-editor/android/app/src/main/res", | ||
"test:e2e:bundle:android:bytecode": "./gutenberg/node_modules/hermes-engine/`node -e \"const platform=require('os').platform();console.log(platform === 'darwin' ? 'osx-bin' : (platform === 'linux' ? 'linux64-bin' : (platform === 'win32' ? 'win64-bin' : 'unsupported-os')));\"`/hermes -emit-binary -O -out gutenberg/packages/react-native-editor/android/app/src/main/assets/index.android.bundle gutenberg/packages/react-native-editor/android/app/src/main/assets/index.android.text.bundle -output-source-map", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an issue for this PR, but it feels like we should start extracting these out into some separate script files for the sake of readability. That might even open up some possibilities for reusing some of our npm script "logic" both here and in gutenberg/packages/react-native-editor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
Non trivial command executions and pipelines, plus very long pathnames are impossible to read. I'd like to work on that, possibly even next week. Please, feel free to also share ideas on how to reuse logic 👍 !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested these changes in the demo app and WPAndroid and everything is working great.
Fixes #1660
This PR is a continuation of #2003, with a simpler approach and just using the bytecode version directly. If it proves more successful I will close the other PR.
Gutenberg PR: WordPress/gutenberg#26732
WPAndroid PR: wordpress-mobile/WordPress-Android#13297
I've left a comment with the (green!) results of my Writing Flow manual tests here.
Changes in this PR
To test:
PR submission checklist: