Open leotm opened 3 months ago
ready for review ^ tackling the testing strategy separately in a follow-up PR, to keep this change small
ready for review ^ tackling the testing strategy separately in a follow-up PR, to keep this change small
Are you familiar with stacked PRs? You can propose the test changes in a PR based on this branch so they can be reviewed together. I would hesitate to approve code that doesn’t come with tests in the same merge, though I’m fine with reviewing them separately. Much depends on your workflow.
One workflow that I like is individually reviewable commits in a single PR. That does require more commit grooming, and it looks like you intend to squash the 21 commits here when you merge.
Another workflow is to create “stacked” PRs for each review artifact, then merge them top to bottom, so that ultimately the feature and its tests arrive in master
with a single merge commit.
Glad to see this!
I would like to make sure @erights looks at these changes as well.
Hopefully tomorrow.
Nb: interestingly this isn't surfaced nor fixed running lint
scripts within the ses
folder
edit: ah it's a Prettier problem, unrelated to ESLint, i.e. fixed with yarn format
ready for review ^ tackling the testing strategy separately in a follow-up PR, to keep this change small
Are you familiar with stacked PRs? You can propose the test changes in a PR based on this branch so they can be reviewed together. I would hesitate to approve code that doesn’t come with tests in the same merge, though I’m fine with reviewing them separately. Much depends on your workflow.
One workflow that I like is individually reviewable commits in a single PR. That does require more commit grooming, and it looks like you intend to squash the 21 commits here when you merge.
Another workflow is to create “stacked” PRs for each review artifact, then merge them top to bottom, so that ultimately the feature and its tests arrive in
master
with a single merge commit.
created the test changes in PR based on this branch to work on here
One workflow that I like is individually reviewable commits in a single PR. That does require more commit grooming, and it looks like you intend to squash the 21 commits here when you merge.
@kriskowal 120ish commits groomed into 6 ^ and all requested changes addressed
Description
Add lockdown shim compatible with HermesMake current shim compatible with Hermes compiler for building React Native (RN) prod apps with SESGenerating the release AAB (Android App Bundle) i.e.
npx react-native build-android --mode=release
via RN CLI calls Gradle'sbundleRelease
task under the hood (bundle
build task onrelease
variant) which calls RNGP (React Native Gradle Plugin) React taskcreateBundleReleaseJsAndAssets
and fails after Metro finishes writing the release bundle (bundle, sourcemaps, assets)Gradle emits these Hermes errors
async functions are unsupported
async generators are unsupported
(at runtime we can see both are
SyntaxError
s) Resulting in vaguejava.lang.StackOverflowError (no error message)
The try/catch approach testing language ft support via a new fn works since RNGP no longer emits the Hermes errors in the task after Metro bundles and we're conditionally using parts of SES compatible with the Hermes engine
The initial approach involved building a new shim via an env var which involved a lot of duplicates
/src
filesNb: clean before bundling to see changes reflected (avoid cache) i.e.
./gradlew clean :app:bundleRelease
Nb:
async function* a() {};
alone won't emit an error but using/referencing it and beyondconst b = a;
willNb: eventually we hit RNGP BundleHermesCTask.kt > run > detectedHermesCommand > detectOSAwareHermesCommand from PathUtils.kt, which calls the Hermes compiler default command
hermesc
- the path of the binary file, to create the optimised bytecode bundle to load/exec at runtimeTODO
./gradlew :app:createBundleReleaseJsAndAssets
./gradlew :app:installRelease -PreactNativeArchitectures=arm64-v8a
yarn <android/ios> --mode release
Follow-up, CI testing options discussed
cd android && ./gradlew :app:bundleRelease
CI(macos): RN app test + SES, Xcode releasetest262:hermes
script (liketest262:xs
)Security Considerations
Scaling Considerations
Documentation Considerations
Testing Considerations
Compatibility Considerations
Upgrade Considerations