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

Migrate to Vue 3 #442

Merged
merged 2 commits into from
Nov 2, 2023
Merged

Migrate to Vue 3 #442

merged 2 commits into from
Nov 2, 2023

Conversation

vincent-olivert-riera
Copy link
Contributor

I have explained all the changes and their reasons in the commit message.
I couldn't split this into different commits without breaking anything.

@vincent-olivert-riera vincent-olivert-riera requested a review from a team as a code owner October 30, 2023 10:10
@vincent-olivert-riera
Copy link
Contributor Author

Changes done. Needs rebasing to:

  • Reorder commits.
  • Squash fixups.
  • Amend commit message.

Copy link
Collaborator

@kfdm kfdm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks good. Lets do a rebase for final approval :)

When running in debug mode, it is necessary to have the INTERNAL_IPS variable
properly set in order to have some functionality.

Before we were assuming that it was only necessary for the Django toolbar,
however, according the documentation [1] it is also necessary for exposing some
variables in the template context, which is something we are going to need in
the future.

1: https://docs.djangoproject.com/en/3.2/ref/settings/#internal-ips
In order to have better control of the version we are using, we have
placed the Vue import into a dedicated folder that includes the version
on its name.

In Vue 3, the devtools are not enabled through 'Vue.config'. They are
always enabled in the development build of Vue 3, and disabled in the
production one.
From now on, when running Promgen in debug mode we will use the
development build of Vue 3. When running Promgen in production mode we
will use the production build of Vue 3, as recommended [1].

In Vue 3, variables that are meant to be reactive (Vue tracks them and
updates the DOM whenever their value changes) need to be created making
use of the 'ref' or 'reactive' functions.

In Vue 3, apps are created with 'Vue.createApp' instead of 'new Vue'.

In Vue 3, 'Vue.set' does not exist, so all the code making use of that
has been rewritten appropriately.

In Vue 3, whitespace characters between elements that contain newlines
are removed by default. Because of that, we need to use the 'whitespace'
compiler option to change that behaviour, otherwise our UI elements such
as buttons will be rendered next to each other without any space in
between.

In Vue 3, components are not created using 'Vue.component'. Instead, the
application instance provides a 'component' method for registering
app-scoped components.

We have moved the instruction for mounting the Vue app at the end of the
'base.html' file to ensure all the necessary DOM elements are ready.

The 'exporter-test-result' component was being mounted on demand using a
'target' property, and also made visible by changing CSS properties from
JavaScript.
That has been replaced by directly placing the component element in the
right location and controlling its visibility with a 'show' property.

1: https://vuejs.org/guide/best-practices/production-deployment.html
@vincent-olivert-riera
Copy link
Contributor Author

This all looks good. Lets do a rebase for final approval :)

Done 👍🏻

@kfdm kfdm merged commit e7aabc9 into master Nov 2, 2023
4 checks passed
@kfdm kfdm deleted the vue-3-migration branch November 2, 2023 07:56
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.

2 participants