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

Refactor Vue components to SFC #1351

Open
jeriox opened this issue Sep 9, 2024 · 0 comments
Open

Refactor Vue components to SFC #1351

jeriox opened this issue Sep 9, 2024 · 0 comments
Labels
[C] refactoring refactors code without changing functionality [P] nice to have features that are not so important

Comments

@jeriox
Copy link
Contributor

jeriox commented Sep 9, 2024

We are currently using Vue components that are built in the browser. This does not allow to re-use custom components in other Vue compontents. Also, JS and HTML are separated in this approach, while SCF keeps all aspects of the component in one file.

We should consider refactoring our components to SCF components.

This bears the question as how to render those. The "traditional" approach would include a build step. We tried copying that over from pretix (which uses https://github.com/codingcatgirl/django-vue-rollup), but the used components (vue-template-compiler, rollup-plugin-vue) are not maintained anymore or do not work with Vue3. It should be possible to recreate such a solution with Vite, but it is not straightforward. An advantage of this approach is that we could shift our JS dependency management to npm as this is required for such a step anyways.

Another approach would be using a tool like https://github.com/FranckFreiburger/vue3-sfc-loader

@jeriox jeriox added [P] nice to have features that are not so important [C] refactoring refactors code without changing functionality labels Sep 9, 2024
@jeriox jeriox mentioned this issue Sep 11, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] refactoring refactors code without changing functionality [P] nice to have features that are not so important
Projects
None yet
Development

No branches or pull requests

1 participant