-
Notifications
You must be signed in to change notification settings - Fork 41
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
Migration to Vue3 and Vuetify3 #411
base: master
Are you sure you want to change the base?
Conversation
…s set on Vue prototype
…qual width and height
Hi team, Just some news concerning unit tests in this PR.
Just tell me what you think about this last point so I know if you'd prefer me to refactor the |
Hi team, Following the release of Here's a quick recap of the issues listed when this PR was created:
Following the opening of discussion #423 I think it would be useful to define what should be addressed in this PR and what could be done separately afterwards. One last point we should all agree is whether the compat build of Vue should be removed from this PR or at a later stage. It would be cleaner to remove it now but could also be useful for you to verify compatibility with your current apps... Don't hesitate to give your opinions and feelings here and ask all the questions you could have concerning implementation choices that were made in this one so we can all keep in-line! Cheers, |
➡️ IMHO this could be solved separately later
➡️ IMHO this could be solved separately later, after merging this PR but should be a must for v3
➡️ IMHO this could be solved separately later
➡️ IMHO this could be solved separately later
➡️ no strong opinion on that |
Hi team, As I couldn't go without at least looking what was going wrong with the AttributeTable, I've looked and found the problem. It is now corrected ! So only two known problems left... however, following latest discussions, I gave a try to replace the I'll post the update later today and comment it so you can all have a look at what has changed, what it would imply to migrate to it in custom apps and whether we go in that direction or revert to the previous commit... |
As promised, here's a proposal of a map This was written with the same logic as the rest of this PR to minimize what was modified. As you'll see, migrating to this implementation would imply to import the composable in place of the mixin, remove the mixin declaration and call the composable inside the Unfortunately, it is not possible to trigger a callback from the If you look at the changes made in this PR, you'll see there was different ways for components to get the map instance. Some were using the Another nice thing is the fact that the As you'll see, I tried to modify as few as possible, that's why you'll see some "strange" things like in the As expected, those changes break a lot of unit tests. Locally, I have 89 test failing for now... however, before adressing them, I wanted to get your impression about whether we keep this Edit: I just refactored the unit tests to use the new map composable. Everything is green again ;-) so if we decide to keep the composable, only the code cleanup and comments adaptation are needed... Just tell me what you think about this and I'll adapt accordingly ! All the best, |
11a1ff2
to
1cd5e1e
Compare
Hi team,
After two months of work on this subject, I think it is time to share a draft of this PR which goal is to migrate
Wegue
toVue 3
andVuetify 3
.Please note this should be considered as a work in progress and is certainly not ready to be accepted as is. I just wanted to share before my summer break so you can all have a look, ask your questions, make some tests, etc...
This was way more difficult than expected at first, migrating
Vue
andVuetify
could not be done separately asVuetify
is written in a low-level way which makes it totally dependent of the usedVue
version. However, I think we're quite close to an update which is not aiming at rewriting the whole framework following new best practices but to transition while changing as few as possible. Improvements can then come afterwards.Don't hesitate to ask questions linked to implementation choices I've made and why I did them, it's the only way to get all in line and get confidence in the work that was done... and you'll certainly have good ideas that will need changes to be done !
All functionalities of Wegue v2.0.2 are included. The two PRs that came afterwards are not present as keeping in sync after every PR merge could be really tedious. So I decided to sync with new releases. Don't worry, the custom icons functionality was already developed with this migration in mind and what should be changed is already defined and was tested !
This PR currently uses the Vue compat build so that you can make some tests with your current applications and warnings will be emitted if incompatible features are still used inside your codebase. You can also tweak which features are assessed and change the behaviour by changing the properties of
compatConfig
insidevue.config.js
and calls toconfigureCompat
insidemain.js
andtests/unit/index.js
refering to the official features list. Believe me, this was really valuable during the first migration steps and at the end to ensure no legacy behaviours were still present !The only drawback is that we can't compare performance and build size with current
Vue 2
implementation for now as this compat build induces some overhead. But it can easily be replaced by the pureVue 3
build by removing theresolve alias
insidevue.config.js
and commenting the calls toconfigureCompat
...Concerning functionalities, there are certainly a few glitches here and there (don't hesitate to report !), but here's the list of known issues that are still present for now :
OpenLayers
internals and selection of features was not working anymore... So I reverted and implemented something so this PR works as current version ofWegue
is (layers list is 'reactive' but layers properties are still not) however, I consider this a potential regression... this is to be discussed for how to go further. Perhaps we can reuse what @fschmenger proposed in Fix layer property reactivity #368 or I thought about making some tests with ashallowReactive
or acustomRef
... All this is present in the latest commit so this one can be reverted to see the buggy trick I used at first... perhaps this could be easily fixed too I don't know... it will take some time to investigate in all cases...Wegue
(so this is not introduced by this PR !) and seems to be linked to infoClick on multiple visible features/layers #367... if you open theInfoClick
, select some earthquakes, consult other items than the first then try to use theMeasure
tool for example, you'll get an exception about undefined features. I report it here for completeness but this is not directly linked to this PR...There are some visual differences due to changes in Vuetify implementations. Some I have tackled as I thought the new visual was really bad (font applied to names of the layers in the base layer switcher for example) but I let the rest with the new styling so we can discuss what to change or not. For example, you can see how sliders are now rendered by default.
Concerning unit tests, there are three very important things to mention here :
vue-test-utils
which makes the test suite unrunnable as is. I opened an issue there with suggestions about what could be changed to correct the problem. Discussions are ongoing and I hope I'll get the approval to open a PR there to correct the problem. In the mean time, you can manually invert two lines in your local installation insidenode_modules
to correct the problem. Just have a look at the VTU issueVue-I18n
where changing of locale inside a unit test breaks translations for the rest of the test suite. To avoid creating a newVue-I18n
instance in each and every test, a global instance was created in tests entry point. To bypass this problem, the only (almost) clean way I've found for now is to create a newVue-I18n
instance in the tests that change the locale. This works, except those tests emit warnings telling a plugin which was already defined is re-defined...WguEventBus
...) but this will be done in the end when and if implementation choices are accepted by all of us...O.K., I think this text is certainly long enough but there you have all the info concerning current state of this PR. Don't hesitate to ask all the questions you have so we can go further (this will certainly take a long time) but don't expect answers before the end of August...
All the best,
Sébastien