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

feat: add basic support for ie 11 #49

Merged
merged 7 commits into from
Dec 29, 2019
Merged

Conversation

alexxyzeng
Copy link
Contributor

主要是为了能够在IE11上运行起来:

  • 修改了.fatterrc的配置,以支持在IE上直接运行
  • /examples/master下增加global.js, 引入whatwg-fetch
  • 将examples的.umirc配置中,增加{ targets: { ie: 11 }
  • 增加当前浏览器环境判断,在IE中替换IE不支持的main标签为div标签

如果需要在Windows系统和IE11浏览器上调试
打开IE11的Internet选项,选择“安全”——“本地Intranet”, 点击下方“站点”,在弹出窗口中取消勾选所有选项;
image
如果需要在其他电脑上通过IE11访问
由于现在master中是通过mock数据来获取微前端配置信息的,需要将注册的微前端的entry替换为对应主机的ip或域名,例如:
image

.fatherrc.js Outdated Show resolved Hide resolved
examples/app1/layouts/index.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@kuitos
Copy link
Member

kuitos commented Dec 25, 2019

ie 兼容以及 polyfill 引入应该是上层自己处理,不应该是插件来搞。example 我觉得也没必要特地针对性做这个事,需要兼容 ie 按照 umi 的标准配置来就可以了,不过可以在 readme 中针对这种需求给出建议或链接

@alexxyzeng
Copy link
Contributor Author

ie 兼容以及 polyfill 引入应该是上层自己处理,不应该是插件来搞。example 我觉得也没必要特地针对性做这个事,需要兼容 ie 按照 umi 的标准配置来就可以了,不过可以在 readme 中针对这种需求给出建议或链接

谢谢指出。主要是发现执行father build后,无法直接在IE中运行。所以修改了.fatherrcexamples相关文件。
另外是否考虑将fetch的polyfill加入到umi-plugin-qiankun或者qiankun中去?

examples/app1/layouts/index.js Outdated Show resolved Hide resolved
examples/master/mock/app.js Outdated Show resolved Hide resolved
@kuitos
Copy link
Member

kuitos commented Dec 25, 2019

兼容性的语法转换及 polyfill 都应该是上层来做,底层库不应该做这种事情

readme/IE兼容性初步解决方案.md Outdated Show resolved Hide resolved
@kuitos
Copy link
Member

kuitos commented Dec 26, 2019

感谢贡献!

ie 支持方案给文档就可以了,不用在 example 里支持,example 是针对一般场景描述的

@alexxyzeng
Copy link
Contributor Author

感谢贡献!

ie 支持方案给文档就可以了,不用在 example 里支持,example 是针对一般场景描述的

已回滚到之前的example状态

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

Successfully merging this pull request may close these issues.

2 participants