feat: expose “queueMicrotask” on global object (#2130)
Summary: I noticed that while Hermes allows to enable microtasks in the engine, it doesn’t expose
queueMicrotaskin the global object thus requiring usingHermesInternalorjsi::Runtime::drainMicrotasks.I don’t know if there’s any particular reason for it not being exposed on the global object but I figured it could be useful.
Pull Request resolved: https://github.com/facebook/hermes/pull/2130
Test Plan: I added a simple test suite.
Reviewed By: avp
Differential Revision: D115567132
Pulled By: tmikov
fbshipit-source-id: d0ad8aa98fe770a03ed5da90379b43dcc62a320c
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Hermes JS Engine
Hermes is a JavaScript engine optimized for fast start-up of React Native apps. It features ahead-of-time static optimization and compact bytecode.
If you’re only interested in using pre-built Hermes in a new or existing React Native app, you do not need to follow this guide or have direct access to the Hermes source. Instead, just follow these instructions to enable Hermes.
If you want to know how to build and hack on Hermes directly, and/or integrate Hermes built from source into a React Native app then read on.
Hermes Blog - Technical articles and deep dives into Hermes internals.
The instructions here very briefly cover steps to build the Hermes CLI. They assume you have typical native development tools setup for your OS, and support for cmake and Ninja. For more details of required dependencies, building Hermes with different options, etc. follow these links instead:
To build a local debug version of the Hermes CLI tools the following steps should get you started on macOS/Linux:
Or if you’re using Windows, the following should get you going in a Git Bash shell:
You will now be in a directory with the output of building Hermes into CLI tools. From here you can run a piece of JavaScript as follows:
Contributing
The main purpose of this repository is to continue to evolve Hermes, making it faster and more efficient. We are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving Hermes.
Code of Conduct
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.
Contributing Guide
Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Hermes.
License
Hermes is MIT licensed.