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

[6.x] Vue 3 #11339

Draft
wants to merge 85 commits into
base: master
Choose a base branch
from
Draft

[6.x] Vue 3 #11339

wants to merge 85 commits into from

Conversation

jasonvarga
Copy link
Member

This upgrades Vue 2 to Vue 3.

This takes over from the awesome progress of #10430.

Includes all the dependencies that were already figured out from the other branch.
This is as-is, with import paths updated.
This doesn't actually make it work yet. This code was taken from other branch.
The old way was triggering a warning which is resolved by using shallowRef. This is mostly changing some syntax and moving things around. No logic change.
- Use modelValue prop and update:model-value event so v-model works
- Add emits because you have to now
- Render function returns first element otherwise this.$el would be a text node.
- Swap $on hook:destroyed for the vue 3 way
- Import Fieldtype everywhere rather than relying on it being on window. (Will figure out the best solution for addons later)
- Bring back registration of fieldtypes
- Bard fieldtypes are commented out since they are quite broken at the moment.
- Remove StatusFieldtype as its not used anymore.
…ypes are ...

For a little bit of consistency.
- Use new v-calendar
- CSS changed a bit due to html changes.
- $screens was removed and the suggested migration path was using vue-screen-utils
- v-calendar props etc needed to change
- Use v-calendar's native popovers instead of our popover components. This *might* reintroduce the z-index issues that we introduced the popovers for initially. Not sure.
- HTML indentation is a bit weird because I was trying to only modify the appropriate lines. Didn't want to reformat the whole template and make the diff harder to understand.
Vue would proxy the class. Then accessing private properties on the class throws errors.
By marking as raw, it avoids Vue adding the proxy.
Popover:
- firstChild is changed to firstElementChild because text nodes would now be included.
- class has to become a prop now.

Portal:
- There's no longer a wrapper div and targetClass prop, so we have to add it ourselves.
- The provide prop needs a default otherwise theres an error.

Portals:
- Passing around a vue instance isn't viable anymore. Replace it with a reactive array in the class.

Stack:
- Same as earlier - need to add a wrapper div in v-portal.

Stacks:
- Can't pass around vue instance, so instead pass along the portals class which now has that reactive array.
Before, if you added class="" to a DropdownList, the class would get added to the trigger wrapper and the popover content itself.

Now you need to be explicit.

<popover class="added to popover" trigger-class="added to trigger wrapper">
Slugify component can no longer v-model.
Inject storeName rather than traversing which causes errors. It's already provided.
It uses a fork of vue-toasted (what we used for vue 2) that has vue 3 support.
I've consolidated the mixin+bus into one class.
Also, simplified and tidied up a few bits.
Converted to beforeUnmount before the $on hook: thing no longer works.
Switch to vue-final-modal since vue-js-modal doesn't support vue 3.

Remove shiftY, adaptive, scrollable, and draggable props. There's not a migration path.

Removed body-scroll-lock stuff since the new modal is locked by default and scrollable prop is gone.

In Modal.vue@close, there's a $wait so it kills the component after the css transition.
In Editor, I removed the modal stuff as it was dead code already. It hasn't been a modal in ages - it was converted to a stack but those lines weren't removed.
Allows things like class="" to be set on it and passed along.
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.

1 participant