Skip to content

SES lockdown Hermes improvements tracking issue #2761

@leotm

Description

@leotm

Now with

done, here are the non-blocking improvements to improve: SES <--> Hermes <--> React Native compatibility

  • whitelistIntrinsics(intrinsics, markVirtualizedNativeFunction);
  • a SES-specific lint rule, like the we have for @endo/polymorphic*, so that we get a lint error if we use this inside an arrow function, since evidently that will break the Hermes version.
  • add a lint rule that warn on async generator usages that Hermes requires special handling (getAsyncGeneratorFunctionInstance) and silence the lint warning in the EvalError fallback case (which has the special handling)
  • fix new Compartment() fails on removeUnpermittedIntrinsics at Tolerating undeletable intrinsics.%CompartmentPrototype%.importNow.prototype === undefined: Uncaught TypeError: property is not configurable
    • add Compartment to Hermes smoke test (snippet)
  • add v0.13.0 for RN0.75.x to endo CI (no npm, github only)
    • The previous main distribution mechanism - hermes-engine.npm and hermes-engine-cli.npm - has been deprecated. At least for now, we don't have plans to restart it, since it appears that all use cases are served by RN. It also appears that - shockingly (at least to me) - NPM is really really bad at efficiently distributing binaries for different platforms, which is why RN chose a different mechanism for distributing our binaries - Maven. Short-hand methods don't have prototype / construct facebook/hermes#1371 (comment)

  • add Hermes "for RN0.76.x" to endo CI (metamask-mobile RN upgrade version)
    • since neither npm nor github distributions exist here, our next best option is to rely on hermes tags .tar.gz's
    • OR npm i react-native@0.76.6 then use node_modules/react-native/sdks/hermesc/osx-bin
    • for custom release branches we must more laboriously build and run hermes
  • add Static Hermes to endo CI - build and run it with cmake git ninja
  • expand Hermes smoke test suite - 1 evalTaming unsafe-eval (done) 2 evalTaming no-eval
  • replace immutableArrayBufferPonyfier Hermes transform with [conditional sync import](feat(immutable-arraybuffer): sliceToImmutable Hermes ponyfill and shim #2785 (comment))

Other

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttrackingFor tracking issues that will never be closed.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions