Skip to content
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

Hermes engine target #2308

Closed
oblador opened this issue Jun 9, 2022 · 4 comments
Closed

Hermes engine target #2308

oblador opened this issue Jun 9, 2022 · 4 comments

Comments

@oblador
Copy link

oblador commented Jun 9, 2022

Hi, I'm using esbuild with react-native via react-native-esbuild and would like to add support for the Hermes engine that is announced to overtake JSC as the default engine. Unfortunately its language feature set is all over the place with many newer features, while some features stuck at es5 level.

If I bundle with target es5, esbuild errors out on many features supported by hermes, but at the same time when using es6 esbuild itself will produce incompatible code (primarily re-exports IIRC). Would you accept a PR adding hermes as an engine?

@evanw
Copy link
Owner

evanw commented Jun 18, 2022

No. Each target is a very heavyweight thing. It's not just a single set of supported features. The target setting lets you specify any past version, so esbuild needs a support matrix for every version and every feature. I have some primary data sources for this for browsers and node, but I have also had to comb through browser bug reports and other random web pages too. This is an ongoing maintenance burden. While I believe it's worth it for browser runtimes, I'm not interested in maintaining additional targets for less-used JavaScript runtimes like Hermes. Instead, I will add the ability for you to specify the support matrix yourself at the individual feature level.

@evanw
Copy link
Owner

evanw commented Jun 18, 2022

I just implemented custom per-feature support overrides. In the next release, you will now be able to e.g. specify --supported:class=false to forbid classes in your code. So I'm closing this issue as what you are asking for will now be possible.

@evanw evanw closed this as completed Jun 18, 2022
@oblador
Copy link
Author

oblador commented Jun 18, 2022

That makes a lot of sense, thank you!

@evanw
Copy link
Owner

evanw commented Jun 30, 2022

Sorry, I didn't realize that Hermes was listed in the data source I already use for browser compatibility data. So it shouldn't be hard to add this after all. So I can add a hermes target in the next release. I'm not sure how accurate or up-to-date that data is but you can always use --supported to override any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants