Skip to content

Commit

Permalink
fix: import nuxt composables from #imports (#458)
Browse files Browse the repository at this point in the history
* fix: import nuxt composables from #imports

* chore: add changeset

* chore: dedupe imports
  • Loading branch information
danielroe committed Nov 8, 2023
1 parent a70d35e commit 135ca37
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/tame-ears-joke.md
@@ -0,0 +1,5 @@
---
"@shopware-pwa/nuxt3-module": patch
---

This improves performance slightly when developing; we can avoid loading the entire barrel file at `#app` by using the new granular imports merged in https://github.com/nuxt/nuxt/pull/23951.
Expand Up @@ -3,11 +3,11 @@ import "@adyen/adyen-web/dist/adyen.css";
import type { SessionContext } from "@shopware-pwa/types";
import {
onMounted,
useNuxtApp,
useSessionContext,
useShopwareContext,
useRuntimeConfig,
} from "#imports";
import { useNuxtApp } from "#app";
const emits = defineEmits<{
// to inform the upper levels of an app that payButton was clicked (that means it was validated by Adyen and we can proceed)
Expand Down
@@ -1,5 +1,4 @@
import { defineNuxtPlugin } from "#app";
import { useRuntimeConfig } from "#imports";
import { defineNuxtPlugin, useRuntimeConfig } from "#imports";
import AdyenCheckout from "@adyen/adyen-web";
import { defu } from "defu";

Expand Down
@@ -1,5 +1,4 @@
import { defineNuxtPlugin } from "#app";
import { useRuntimeConfig } from "#imports";
import { defineNuxtPlugin, useRuntimeConfig } from "#imports";
import { CreateLocaleInstanceArgs, MolliePlugin } from "../../types";

export default defineNuxtPlugin({
Expand Down
@@ -1,5 +1,4 @@
import { defineNuxtPlugin } from "#app";
import { useServerHead } from "#imports";
import { defineNuxtPlugin, useServerHead } from "#imports";

export default defineNuxtPlugin({
name: "mollie-register",
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt3-module/plugin.ts
@@ -1,6 +1,6 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
import { defineNuxtPlugin, useRuntimeConfig, useCookie, useState } from "#app";
import { defineNuxtPlugin, useRuntimeConfig, useCookie, useState } from "#imports";
import {
createShopwareContext,
getDefaultApiParams,
Expand Down

2 comments on commit 135ca37

@vercel
Copy link

@vercel vercel bot commented on 135ca37 Nov 8, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 135ca37 Nov 8, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

frontends-demo – ./templates/vue-demo-store

frontends-demo-shopware-frontends.vercel.app
frontends-demo.vercel.app
frontends-demo-git-main-shopware-frontends.vercel.app

Please sign in to comment.