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

使用 umi 创建的应用,作为子应用在主应用经过 qiankun 的加载,数组的 split 方法会被污染,不再支持正则表达式。 #7762

Closed
blueju opened this issue Jan 6, 2022 · 3 comments

Comments

@blueju
Copy link
Contributor

blueju commented Jan 6, 2022

What happens?

使用 umi 创建的应用,作为子应用在主应用经过 qiankun 的加载,数组的 split 方法会被污染,不再支持正则表达式。

我一开始以为是 qiankun JS 沙箱代理的问题,所以在 qinakun 里提了 issue,后面测试发现 React 应用作为子应用在主应用经过 qiankun 的加载,数组的 split 方法并不会被污染,仍然支持正则表达式。

更多详细情况可以前往该地址查看:
umijs/qiankun#1892

Mini Showcase Repository(REQUIRED)

Please provide a repository using yarn create @umijs/umi-app then upload to your GitHub 请提供一个可复现的仓库,使用 yarn create @umijs/umi-app 创建,并上传到你的 GitHub 仓库

CodeSandbox 无法运行复现仓库

基座:https://github.com/blueju/ngfe-main-app
子应用:https://github.com/blueju/ngfe-sub-app

How To Reproduce

Steps to reproduce the behavior: 1. 2.

Expected behavior 1. 2.

Context

  • Umi Version: 3.5.20
  • Node Version: v14.18.1
  • Platform: 10.0.19042.1415
    image
  • 浏览器版本:IE 20H2
    image
@blueju
Copy link
Contributor Author

blueju commented Jan 7, 2022

@sorrycc @chenshuai2144 @ycjcl868 @xiaohuoni @yutingzhao1991
麻烦各位大佬了,谢谢~

@blueju
Copy link
Contributor Author

blueju commented Jan 7, 2022

@blueju
Copy link
Contributor Author

blueju commented Jan 11, 2022

问题已解决,不过是曲线救国,使用 core-js-bundle@3.20.2 在子应用入口文件 app.ts 引入,将错误的 split 方法进行重置,详见以下 commit:
blueju/ngfe-sub-app@b15fa21

@sorrycc sorrycc closed this as completed Jul 4, 2022
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

No branches or pull requests

2 participants