From 86aa9ff475258b8ed069753732fc566b5ac040e8 Mon Sep 17 00:00:00 2001 From: Teranode Date: Sat, 25 Feb 2023 17:52:20 +0200 Subject: [PATCH] Revert back to vuetify instance creation https://github.com/vuetifyjs/vuetify/releases/tag/v3.1.6 - This should solve the issue with the memory leak, so now reverting back to using vuetify's createVuetify instance --- README.md | 4 +++- package.json | 12 ++++++------ src/module.ts | 5 +++-- src/runtime/templates/plugin.mjs | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b317d0e..abe901b 100644 --- a/README.md +++ b/README.md @@ -70,4 +70,6 @@ There is a bug with vuetify where custom scss files might not function correctly #### 2. Theme values not applying & memory leak (Source: https://github.com/vuetifyjs/vuetify/issues/16156) -There's currently a bug with vueuse/head where it's potentially causing a memory leak and also not adapting changes when using the `useTheme` composable. For now, I have made a workaround where the module will be running its own `createVuetify` instance inheriting from vueitfy and making the necissary changes to make it function. Until this is fixed thta will be used instead. +~~There's currently a bug with vueuse/head where it's potentially causing a memory leak and also not adapting changes when using the `useTheme` composable. For now, I have made a workaround where the module will be running its own `createVuetify` instance inheriting from vueitfy and making the necissary changes to make it function. Until this is fixed thta will be used instead.~~ + +This should have been fixed in vueitfy's `3.1.6` version. \ No newline at end of file diff --git a/package.json b/package.json index 1444350..4d6a960 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nuxt-alt/vuetify", - "version": "1.1.0", + "version": "1.1.1", "description": "An alternative module for setting up Vuetify 3 with nuxt.", "homepage": "https://github.com/nuxt-alt/vuetify", "author": "Teranode", @@ -27,14 +27,14 @@ "dev:prepare": "unbuild --stub && nuxi prepare playground" }, "dependencies": { - "@nuxt/kit": "^3.1.1", - "sass": "^1.58.0", + "@nuxt/kit": "^3.2.2", + "sass": "^1.58.3", "vite-plugin-vuetify": "^1.0.2", - "vuetify": "^3.0.5" + "vuetify": "^3.1.6" }, "devDependencies": { - "@types/node": "^18.11.18", - "nuxt": "^3.1.1", + "@types/node": "^18.14.1", + "nuxt": "^3.2.2", "unbuild": "latest" }, "repository": { diff --git a/src/module.ts b/src/module.ts index 15fe693..ebae12f 100644 --- a/src/module.ts +++ b/src/module.ts @@ -73,11 +73,12 @@ export default defineNuxtModule({ }) // Runtime - nuxt.options.alias['#vuetify'] = resolve('./runtime/vuetify'); + // Todo: Remove in next build and it's remnants + //nuxt.options.alias['#vuetify'] = resolve('./runtime/vuetify'); // vuetify-specific composables addImports([ - { from: resolve('./runtime/theme'), name: 'useTheme' }, + { from: CONFIG_KEY, name: 'useTheme' }, { from: CONFIG_KEY, name: 'useDisplay' }, { from: CONFIG_KEY, name: 'useRtl' }, { from: CONFIG_KEY, name: 'useLocale' }, diff --git a/src/runtime/templates/plugin.mjs b/src/runtime/templates/plugin.mjs index db17a57..0d784f0 100644 --- a/src/runtime/templates/plugin.mjs +++ b/src/runtime/templates/plugin.mjs @@ -1,5 +1,5 @@ import { defineNuxtPlugin } from '#imports'; -import { createVuetify } from '#vuetify'; +import { createVuetify } from 'vuetify'; const opts = JSON.parse('<%= JSON.stringify(options) %>')