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

IE11 compatability issue #439

Closed
erikarenhill opened this issue May 4, 2020 · 7 comments
Closed

IE11 compatability issue #439

erikarenhill opened this issue May 4, 2020 · 7 comments
Labels

Comments

@erikarenhill
Copy link
Contributor

I'm running a react-project built with webpack and there is 1 line that breaks IE11 due to ES6 features being used (dynamic property name)

https://github.com/leandrowd/react-responsive-carousel/blob/master/src/cssClasses.ts#L7

The above line is the only thing that I found that needs to be fixed to have it work in IE11.

Would you consider a PR if I add one for it? That way we can have IE11 supported without transpiling the component locally to ES5 before building.

@leandrowd
Copy link
Owner

Sure, send the pr and we will get it through...

@erikarenhill
Copy link
Contributor Author

erikarenhill commented May 4, 2020

Sure, send the pr and we will get it through...

Looking a bit more into this I notice the babelrc actually exclude IE11 explicitly, if the component should support IE11 (what's your take on this @leandrowd ?) maybe it's just easier to include it to get the transpilation done if more ES6 features are used in the future.

Because it would feel quite cumbersome to do a PR with a code change to support IE11 when babel is configured to ignore IE11 in any future other code changes.

The tsconfig also specify that ES5 should be used, so these two configurations would not really play nicely with eachother.

Checking out the code locally I also need to explicitly allow babel to transpile .ts by adding the --extension ".ts" flag (just following the contribution guidelines, running nvm use etc doesn't work out of the box until I add this flag to babel).

Thanks for the great work

@ludem
Copy link

ludem commented May 5, 2020

Hi, I got an error on IE11 because of the following lines in Thumbs.js, where shorthand property names (ES2015) are used (not supported in IE11):

 _this.setState(function (_state, props) {
        return {
          itemSize,
          visibleItems,
          firstItem: showArrows ? _this.getFirstItem(props.selectedItem) : 0,
          lastPosition,
          showArrows
        };
      });

leandrowd added a commit that referenced this issue May 6, 2020
gh-439: Allow IE11 compilation and more
@leandrowd
Copy link
Owner

Babel config has been changed and a new version published. Could you please update and confirm that your problem is resolved? thanks

@ludem
Copy link

ludem commented May 6, 2020

Unfortunately my problem is not resolved with the new version. I got the same error above in development mode, while in production the following line breaks:

m=function(e){return v()({"carousel-root":!0,[e]:!!e})}

[e] is a computed property name, not supported in IE11

@erikarenhill
Copy link
Contributor Author

Unfortunately my problem is not resolved with the new version. I got the same error above in development mode, while in production the following line breaks:

m=function(e){return v()({"carousel-root":!0,[e]:!!e})}

[e] is a computed property name, not supported in IE11

This is the same issue as I reported in the first post, I could solve this locally by changing the babelrc, will try again with this new one

@stale
Copy link

stale bot commented Jul 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 2, 2021
@stale stale bot closed this as completed Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants