Use shallowRef instead of ref in .vue files where possible#34813
Merged
Conversation
Contributor
Author
|
I just looked at the code again, and I think there are a few more places where we can use shallowRef. I can't get my local gitea environment to work, so please check these changes they seam logical to me. I tried to quadruple-check, but I'm sometimes stupid. Please test it. :) |
wxiaoguang
reviewed
Jun 22, 2025
wxiaoguang
reviewed
Jun 22, 2025
wxiaoguang
reviewed
Jun 22, 2025
wxiaoguang
reviewed
Jun 22, 2025
wxiaoguang
reviewed
Jun 22, 2025
wxiaoguang
reviewed
Jun 22, 2025
Contributor
wxiaoguang
left a comment
There was a problem hiding this comment.
Thank you very much.
The code was refactored from Vue2 by many steps, so some bad smells were left there. 😄
delvh
approved these changes
Jun 22, 2025
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
wxiaoguang
approved these changes
Jun 22, 2025
Contributor
wxiaoguang
left a comment
There was a problem hiding this comment.
Great work, thank you very much.
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Jun 23, 2025
* giteaofficial/main: (22 commits) [skip ci] Updated translations via Crowdin Fix required contexts and commit status matching bug (go-gitea#34815) Add "Cancel workflow run" button to Actions list page (go-gitea#34817) Use `shallowRef` instead of `ref` in `.vue` files where possible (go-gitea#34813) Edit file workflow for creating a fork and proposing changes (go-gitea#34240) Refactor packages (go-gitea#34777) Refactor wiki (go-gitea#34805) [skip ci] Updated translations via Crowdin Upgrade htmx to 2.0.5 (go-gitea#34809) Forks repository list page follow other repositories page (go-gitea#34784) Add post-installation redirect based on admin account status (go-gitea#34493) Rework delete org and rename org UI (go-gitea#34762) Refactor editor (go-gitea#34780) Improve img lazy loading (go-gitea#34804) [skip ci] Updated translations via Crowdin Fix Feishu webhook signature verification (go-gitea#34788) Upgrade chi to v5.2.2 (go-gitea#34798) Fix the issue of abnormal interface when there is no issue-item on the project page (go-gitea#34791) Fix container range bug (go-gitea#34795) Fix OCI manifest parser (go-gitea#34797) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference:
This PR improves some
.vuecomponents by usingshallowRef instead of ref, whichshould improve performance. It's probably not significant, but it's an improvement because Vue no longer deep watches the ref (shallowRef).Also i used
useTemplateRefinstead ofrefI tested it locally, but I could have missed something, so please test it on your machine. Thank you!