react-dropzone / attr-accept

JavaScript implementation of the "accept" attribute for HTML5 input element
MIT License
110 stars 24 forks source link

es5 compatibility #48

Closed ayal closed 4 years ago

ayal commented 4 years ago

This PR broke es5 compatibility: https://github.com/react-dropzone/attr-accept/pull/47 module field now points to the original, non-transpiled source - this might be considered a breaking change

react-dropzone itself has a module field but it has another build for es: https://github.com/react-dropzone/react-dropzone/blob/master/package.json#L11 https://github.com/react-dropzone/react-dropzone/blob/master/package.json#L5

okonet commented 4 years ago

es5 should be consumed from main field. module field is specific to ES6 afaik.

okonet commented 4 years ago

I'm not sure we need the build step here since it's just one function that is ES6 compatible. It uses https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some and https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith

ayal commented 4 years ago

I'm not sure this is the convention. https://babeljs.io/blog/2018/06/26/on-consuming-and-publishing-es2015+-packages#conflating-javascript-modules-and-es2015 https://github.com/rollup/rollup/wiki/pkg.module

okonet commented 4 years ago

Okay it seems the whole thing evolved since I last checked. Please create a PR for the fix.

Murali-Kwikee commented 4 years ago

Yeah, this is is breaking my build.

filipkastovsky commented 4 years ago

This also broke my build, changing my bundler cfg to resolve modules with mainFields: [ ... , 'main', 'module', ... ] in this order worked for me. This fixes the issue locally, but doing so might break your build as well and is really hacky. A possible quick fix until a PR by @ayal is resolved, that might be worth mentioning nevertheless.

github-actions[bot] commented 4 years ago

:tada: This issue has been resolved in version 2.2.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: