react-jsx-parser icon indicating copy to clipboard operation
react-jsx-parser copied to clipboard

IE11 not working with es5 version

Open kevich opened this issue 3 years ago • 3 comments

IE11 does not support arrow functions ()=>{}(https://caniuse.com/arrow-functions), but seems like in https://github.com/TroyAlford/react-jsx-parser/blob/develop/dist/es5/react-jsx-parser.min.js there are some arrow functions, which leads to not working code in IE11.

kevich avatar Mar 01 '21 07:03 kevich

Sorry guys :\ At this point, given that Microsoft no longer supports IE11, I have no intention of continuing to support IE11 for my open-source projects, like this one.

That said, I am open to a PR if someone else wants to take it on?

TroyAlford avatar Apr 07 '21 23:04 TroyAlford

I understand your intention not to support IE11, but your library is used on a lot of large production sites that unfortunately have to support IE11 :)

Do you think the scope of the changes to support IE11 are limited to arrow functions, meaning transpilation is just needed?

ZLevine avatar Aug 05 '21 14:08 ZLevine

That may be all it takes, yes. The library doesn't actually do anything particularly hairy, itself. The bulk of the lib's size, though, is based on importing/packaging acorn js, so the issue (if there is one) would be to transpile/package that sufficiently.

That said, I think it's important to offer 2 separate packages, because of the file-size difference.

  1. an es6/modern implementation, to be used by evergreen browsers
  2. an es5/transpiled implementation, to be used specifically for ie11

It may be as straightforward as simply setting babel's browserslist target to ie11 and getting the webpack/typescript to honor targeting es5, and splitting the output to the two above-described targets.

This is what I had set up prior, but it broke - and since MS no longer supports IE11, I am of the personal belief that we should push the web forward, as engineers, by letting the poor baby die instead of continuing to monkey-patch open-source projects and such to support it (which only encourages the industry, as a whole, to support 10-year-old broken software).

/rant off :) If you're interested in adding the support back in, I'm totally open to a PR for it, which is why I left this ticket open with the help-wanted label to begin with. :)

TroyAlford avatar Aug 06 '21 16:08 TroyAlford