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

fix(v2): Resolve IE11 compatibility issues (Fixes #1784) #1808

Closed
wants to merge 2 commits into from

Conversation

andresmanelli
Copy link

Motivation

I need to create a site that is compatible with IE11 and I like the simplicity of this project.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

I just ran yarn test and had the same result than v2.0.0-alpha.25 (I think because of Windows paths)

This is a screenshot of the website in IE11 (not perfect, but ok)

Capture

Related PRs

None

Disclaimer: I am no web developer :) so all reviews are welcome. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Oct 4, 2019
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Oct 4, 2019

Deploy preview for docusaurus-2 failed.

Built with commit 67e7105

https://app.netlify.com/sites/docusaurus-2/deploys/5d975d082f62940008b743b9

@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Oct 4, 2019

Deploy preview for docusaurus-preview ready!

Built with commit 67e7105

https://deploy-preview-1808--docusaurus-preview.netlify.com

Copy link
Contributor

@endiliey endiliey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's overkill to polyfill whole corejs.
Why not just polyfill object.assign ?

https://github.com/sindresorhus/object-assign is a good solution.

WDYT ?

@andresmanelli
Copy link
Author

I will try that, although I found other issues when only importing that specific method from core-js.

I'll let you know asap

@endiliey
Copy link
Contributor

endiliey commented Oct 4, 2019

ie11 polyfill from cra https://github.com/facebook/create-react-app/blob/master/packages/react-app-polyfill/ie11.js

naturally it will be best if we can utilize it like babel preset env browserslist integration because importing "core-js" loads polyfills for every possible ECMAScript feature: what if you know that you only need some of them?

@endiliey
Copy link
Contributor

endiliey commented Oct 4, 2019

Currently our babel-preset-env use the default options

presets: ['@babel/env', '@babel/react'],

Maybe can utilize https://babeljs.io/docs/en/babel-preset-env#usebuiltins 'usage'
so that polyfills will be added automatically when the usage of some feature is unsupported in target environment

@andresmanelli
Copy link
Author

I added the useBuiltIns option, but I'm not able no build locally any more due to #1782 I think (maybe netlify/docusaurus-2/deploy-preview has the same issue?)

@endiliey
Copy link
Contributor

endiliey commented Oct 4, 2019

the error is not related to #1782

maybe usebuiltins option doesnt work.

@andresmanelli
Copy link
Author

I can confirm the addition of the useBuiltIns option makes the build crash. I don't really know a good workaround. Should I close this PR or do you have any ideas ? Thank you !

@endiliey
Copy link
Contributor

endiliey commented Oct 7, 2019

polyfill features that are missing to ie11 only without importing whole corejs ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants