malchata/yall.js

3.1.7 issue in IE11 (with polyfill)

ihardyslide opened this issue · 3 comments

Hi,

this week I upgraded from yall 2 to 3.1.7.
I've done this for two projects:

  • one bundled by parcel
  • one bundled by a combination of gulp & rollup.

I added the polyfill for IntersectionObserver as advised.

The problem I have, is in the project bundled by parcel, the other one is working fine by chaining a rollup-plugin-babel in there.
Somehow, parcel does not transform the required yall module, which is a problem, because it always delivers code with arrow functions (=>), which are not supported by IE11 and causes everything to crash.

I've read like 20 GitHub issues e.g.:

parcel-bundler/parcel#2500
parcel-bundler/parcel#13
parcel-bundler/parcel#559
parcel-bundler/parcel#2073

and so on, but there seems to be no real solution.
May I ask why there are arrow functions in the dist files when it aims to support IE11?

Any hint in the right direction would be highly appreciated!

Thanks in advance

Hi,

we have fixed it with a workaround, by copying a .browserslistrc file in the node_modules directory of your yall-js module.
The content of it is e.g. node 13.

Since you don't have this file by default, parcel just thinks your code is written without using new features (so parcel thinks this module supports everything) and there is no need to transpile with babel.

When we add this file before parcel runs, parcel respects it, sees that there is a discrepancy between your and our browserlist and therefore transpiles before it bundles everything.

I suggest putting this file in your repository, so others won't run in the same issue as me or something similar.

Br

Interesting. I haven't tested this with Parcel, but I've been wanting to pull config out to separate files anyway. I'll do this for the next release and follow up with you.

D'oh, closed by mistake.