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

新建文章,切换页面,必卡死 #4798

Closed
RuanLia opened this issue Oct 31, 2023 · 3 comments · Fixed by #4805
Closed

新建文章,切换页面,必卡死 #4798

RuanLia opened this issue Oct 31, 2023 · 3 comments · Fixed by #4805
Assignees
Labels
area/console Issues or PRs related to the Halo Console area/editor Issues or PRs related to the Editor kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Milestone

Comments

@RuanLia
Copy link

RuanLia commented Oct 31, 2023

是什么版本出现了此问题?

2.10

使用的什么数据库?

PostgreSQL

使用的哪种方式运行?

Docker Compose

在线站点地址

体验环境也可复现

发生了什么?

选择默认编辑器(其他编辑器没测过)插入表格,不保存,点击其他功能退出文章页面,然后在点回刚刚的新建文章页面,这时候页面就会卡死;

相关日志输出

No response

附加信息

b5ea097ad21595a822e23250614f528

@ruibaby
Copy link
Member

ruibaby commented Oct 31, 2023

/priority critical-urgent
/area console
/area editor
/kind bug

@ruibaby ruibaby added priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. area/console Issues or PRs related to the Halo Console area/editor Issues or PRs related to the Editor kind/bug Categorizes issue or PR as related to a bug. labels Oct 31, 2023
@LIlGG
Copy link
Member

LIlGG commented Oct 31, 2023

/assign

@ruibaby
Copy link
Member

ruibaby commented Oct 31, 2023

/milestone 2.11.x

@f2c-ci-robot f2c-ci-robot bot added this to the 2.11.x milestone Oct 31, 2023
f2c-ci-robot bot pushed a commit that referenced this issue Nov 2, 2023
#### What type of PR is this?

/kind bug

#### What this PR does / why we need it:

优化了编辑器的性能,并解决了卡死现象。具体措施如下:

1. 编辑器异步加载时,由于其 component 并不会使用响应式,所以也无需进行代理,因此使用 `markRaw` 将其转为普通对象,可以优化 vue 性能。
2. 由于 `DefaultEditor` 有多个根节点导致透传的 attrs 无法设置,因此新增一个 div 节点将其原有节点包裹。参见 https://cn.vuejs.org/guide/components/attrs.html#attribute-inheritance-on-multiple-root-nodes 。
3. 原有编辑器实例在切换路由之后不会释放,此次修改之后,将在 vue 的 `onBeforeUnmount` 时间中手动释放编辑器实例。

#### How to test it?

1. 新建文章,新建一个表格。
2. 不要保存,点击文章路由跳出编辑器界面,再次点击上一次所编辑器的文章,查看是否会卡死。

#### Which issue(s) this PR fixes:

Fixes #4798 

#### Does this PR introduce a user-facing change?
```release-note
优化编辑器性能并解决切换页面所造成的卡死现象
```
@JohnNiang JohnNiang modified the milestones: 2.11.x, 2.11.0 Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/console Issues or PRs related to the Halo Console area/editor Issues or PRs related to the Editor kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants