graphql-ast-types icon indicating copy to clipboard operation
graphql-ast-types copied to clipboard

Using this lib in browsers

Open djhi opened this issue 5 years ago • 2 comments

Hi, thanks for this library :)

We have an issue using it in CRA app though, because the babel env preset is configured to target node only. Would you agree a PR adding the following to it?

"targets": {
  "node": "6.10",
+ "browsers": ["last 2 versions"]
}

PS: we use it in react-admin for the grahql data providers.

djhi avatar Sep 07 '18 14:09 djhi

Thanks for opening this issue. I'm glad you're finding it useful!

I think it's perfectly reasonable to add browser support but we'll need to bundle it for cases where babel isn't in the consumer pipeline. I'll take a look adding this to next branch.

imranolas avatar Sep 18 '18 07:09 imranolas

Thanks for the attention 💯

In the meantime, I plugged the fork I made as a dependency of React Admin.

https://github.com/marmelab/react-admin/blob/18fcad87653c0035ff13bddcc8bddc4425c5ebdd/packages/ra-data-graphql-simple/package.json#L35

But this is a problem for our users that can't download dependencies from a GitHub repositories. https://github.com/marmelab/react-admin/issues/2398

Do you plan to release the update anytime soon? I might also publish a npm package as a temporary workaround if you are lacking of time.

Kmaschta avatar Oct 21 '18 17:10 Kmaschta