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

Consider adding browsers with at least 1% to .babelrc #52

Closed
narthollis opened this issue Mar 9, 2018 · 5 comments
Closed

Consider adding browsers with at least 1% to .babelrc #52

narthollis opened this issue Mar 9, 2018 · 5 comments

Comments

@narthollis
Copy link

I really enjoy working with elastic-builder to develop queries, and have we use it quite heavily in our web apps.

I do however need to support a number of browsers that do not currently support a number of "modern" ES features, such as template strings. This means that I am currently unable to use elastic-builder as the node>=4 babel env is outputting code that can not be consumed.

I was hoping you would consider adding "browsers": [">1%"] to your .babelrc to output code that is compatible with a wide range of browsers as well as Node JS.

@sudo-suhas
Copy link
Owner

This came up in #45 as well. I am reconsidering whether to accept that PR to accommodate users wanting to use it in the browser. On the other hand, I feel it is not advisable to ship ~35KB of gzipped JS to the client.

@narthollis
Copy link
Author

narthollis commented Mar 9, 2018

Ah, I see. Fair enough - valid reasoning.

Given the bundle sizes in the apps I am working on 35KB is an easy trade off for the ease of readability and improved ability for devs to quickly write elastic queries.

-rwxrwxrwx 1 user user 2.3K Mar  9 14:53 0-c8fb551e441a42497241.js
-rwxrwxrwx 1 user user 2.9M Mar  9 14:53 app-2c174eb6386f025c4ede.js
-rwxrwxrwx 1 user user 1.5K Mar  9 14:53 manifest-5a121c24088ac6d612d5.js
-rwxrwxrwx 1 user user 2.9M Mar  9 14:53 vendor-64f4daf7eb0a3ca0c295.js

Given the plans you spoke of in #45 I will probably look at creating a local elastic-builder package that has been transpiled for use in the web.

Thanks for the quick response and an excellent package.

@sudo-suhas
Copy link
Owner

Given the plans you spoke of in #45 I will probably look at creating a local elastic-builder package that has been transpiled for use in the web.

Hold off on that. Since this is a common use-case, this is what I am thinking of doing. Do not use transpiled source for tests and the default export. This simplifies a lot of things in terms of the repo build steps etc. But at the same time, use babel for a transpiled copy which could be accessible via require('elastic-builder/t')

@josh-degraw
Copy link
Contributor

Are there any updates on this issue? I've just been running into the exact same problem.

@sudo-suhas
Copy link
Owner

Since multiple users are making this change request, I would be happy to accept a PR which updates the .babelrc. Ideally this should have been sorted out in #45. Otherwise, I will try to dedicate some time next week to do the required changes.

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

3 participants