suguru03/aigle

Publish pre-compiled version for ES5

jmurgey opened this issue ยท 8 comments

Hello !

I encountered an issue with aigle when trying to use it in production.

I am developing a React app based on Create React App. When I try to build it in production, it fails at minification step because of aigle as its code is not compiled for ES5. You can have more details here: npm run build fails to minify

Could you publish a pre-compiled version of aigle compatible with ES5 ?

Thanks a lot !

@jmurgey
Thank you for the issue! ๐Ÿ™‚
Is it the same issue as #21?
Which version are you using?

It looks like something different, I didn't have any problem until I tried to build for production.
I am using the latest stable version published on npm (v1.12.0).

aigle is written with ES6 syntax that is not supported by some browsers and tools. create-react-app compiles all the source code to ES5 syntax during its build process and assume that all third-party libraries used in the code are already compiled for ES5. Any ES6-only syntax breaks the minification step of create-react-app build process.

The version should have an es5 minified file.
Do you know how I can reproduce the issue?

I have some react and react-native projects.
Also, I have created a test project, but everything seems to work fine for me.
https://github.com/suguru03/test-react

Ok, i reproduced the problem with your test code. The difference is that you import the whole aigle package to use one function.

import Aigle from 'aigle';
...
Aigle.delay(1000);

To avoid importing too many files that I don't use, I directly import the file of the function I use.

import delay from 'aigle/delay';
...
delay(1000);

When I use your way to import aigle, npm run build works fine, but not when I'm importing single files.

Oh, I see.
I need to investigate the issue ๐Ÿค”
Thanks for the issue ๐Ÿ˜„

@jmurgey
Hi, I added some code to handle the issue and published it on v1.13.0-alpha.10.
It seems to be working well.
Could you test it? Thanks! ๐Ÿ™‚

@suguru03
Hi, thanks for your fast investigation. I have just tried and it works very well!

Thanks for the testing! ๐Ÿ˜„
If you find any issues, please feel free to let me know!