-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Use vue instead of plain template to render suscribe div of issue #28914
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "partially page reloading" (eg: htmx
or jQuery.load
or some Gitea's frontend mechanisms) is more suitable for this case, because overall Gitea is using backend template rendering heavily.
Using Vue for small components would make some things more complex:
- Page flickering (because the Vue components are rendered after the page is loaded/rendered), some people dislike such flickering, then to fix such flickering it requires more hacky code.
- Additional work for maintaining status/locale, additional JavaScript code.
Personally I prefer to fine tune existing mechanisms like link-action
/ form-fetch-action
, while since most people like htmx and there would be some standards, so I think htmx could also do well.
Isn't for example the loading indicator missing? Overall, I can mostly agree with @wxiaoguang - we should not mix go templates and vue heavily, it creates confusion, makes refactoring harder, adds additional code which can be avoided usind htmx and so on. I could imagine full Vue rewrites being beneficial for some components that are designed as dynamic in the first place, but for such small elements htmx looks like a better solution. |
The loading added, but the real problem is the div flickering @wxiaoguang mentioned. An obvious layout reaggrange can be found in the area of the subscribe button. The external div of the button needs a fixed height if we want to avoid that. |
Close as htmx version merged. |
This PR did two things.
initComponent
which can make the component initlize simple than beforeissue/Suscribe.vue
to instead of old template methodThis can be compared with #28908 about a different framework to do the same thing.