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 140 commits into
base: master
Choose a base branch
from
Draft

[6.x] Vue 3 #11339

wants to merge 140 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.
- Open/close state wasn't being saved. Had to do it differently due to the draggable tree package being updated. Now IDs gets stored on an array and a watcher saves it to local storage.
- IDs are now saved to local storage (for now?) purely because I couldn't figure out how to do paths in a timely manner.
- Fixed removing a page not doing anything (in pageRemoved)
Scrapped the polyfill, it's so widely supported.
Scrapped the underscore mixins, we don't use them.
Scrapped file_icon and resource_url, we don't use them.
Now users can do

import { Fieldtype } from '../../vendor/statamic/cms/resources/js/exports.js'
export default {
  mixins: [Fieldtype]
}

OR

If they add resolve.alias.statamic to their vite.config.js they can simplify it further:

resolve: {
  alias: {
    statamic: path.resolve(__dirname, './vendor/statamic/cms/resources/js/exports.js'),
  },
}

import { Fieldtype } from 'statamic';
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