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: 修复wujie-react偶现无法加载子应用元素 #599

Merged
merged 1 commit into from
Jun 30, 2023

Conversation

PgFish
Copy link
Contributor

@PgFish PgFish commented Jun 14, 2023

  • 提交符合commit规范
  • 文档更改
  • 测试用例添加
  • npm run test通过
详细描述
  • 特性
  • 关联issue

@yiludege yiludege merged commit f927505 into Tencent:master Jun 30, 2023
@towertop
Copy link

这个修改还是引入了保活模式(alive=true)无法渲染的问题。问题路径是这样的,此次修改取消了 this.startAppQueue 保护的异步过程,导致 React 在多次组件绘制中的竞争,在我碰到的场景里,沙盒的初次初始化new Wujie()到激活sandbox.active()之间引入了第二次startApp()抢先把this.template = undifined渲染到了this.shadowRoot中并且继续的第一次初始化因为 alive 跳过了渲染,空的html使得子应用挂载失败。

修复很简单,在这个修复的基础上 componentDidMount 中把 this.startAppQueue 保护再加回来。不清楚这个修复解决的问题根因。如果没问题我可以提 PR。谢谢。

@yiludege
Copy link
Collaborator

可以的,感谢贡献

@m-initiator
Copy link

请问this.startAppQueue加回去了吗,升级到这个版本后,子应用加载一直是undifined,document.getElementById('root')获取到的是null。

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.

4 participants