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

fix: Improve compatibility of AsyncIterable helpers for polyfills (Babel/Hermes related) #165

Merged
merged 7 commits into from
Jul 20, 2023

Conversation

kitten
Copy link
Member

@kitten kitten commented Jul 20, 2023

Summary

This replaces Symbol.asyncIterator with a polyfill implementation, similar to Symbol.observable. It also refactor toAsyncIterable to return an object implementing both the AsyncIterator and AsyncIterable shape.

This change should improve compatibility with async iterator polyfills, specifically Babel transpilations, since it won't require the Symbol.asyncIterator polyfill to be included manually and can deal with how async iterable code is transpiled by Babel, specifically for the Hermes engine in React Native.

Set of changes

  • Update toAsyncIterable to also implement AsyncIterator shape
  • Add asyncIteratorSymbol polyfill to helpers
  • Move observableSymbol to helpers

@kitten kitten force-pushed the feat/hermes-async-iterator branch from c1893fa to b2dc627 Compare July 20, 2023 15:13
@kitten kitten merged commit c160e1d into main Jul 20, 2023
1 check passed
@kitten kitten deleted the feat/hermes-async-iterator branch July 20, 2023 15:24
@github-actions github-actions bot mentioned this pull request Jul 20, 2023
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

Successfully merging this pull request may close these issues.

1 participant