performance improvements

This commit is contained in:
Tobias Koppers 2021-06-21 16:11:41 +02:00
parent 559451f958
commit 277ad4943d
6 changed files with 400 additions and 11299 deletions

View File

@ -11,7 +11,7 @@ interface Props {
className?: string
product: Product
noNameTag?: boolean
imgProps?: Omit<ImageProps, 'src'>
imgProps?: Omit<ImageProps, 'src' | 'layout' | 'placeholder' | 'blurDataURL'>
variant?: 'default' | 'slim' | 'simple'
}

View File

@ -1,4 +1,4 @@
import useSWR, { responseInterface } from 'swr'
import useSWR, { SWRResponse } from 'swr'
import type {
HookSWRInput,
HookFetchInput,
@ -11,7 +11,7 @@ import type {
import defineProperty from './define-property'
import { CommerceError } from './errors'
export type ResponseState<Result> = responseInterface<Result, CommerceError> & {
export type ResponseState<Result> = SWRResponse<Result, CommerceError> & {
isLoading: boolean
}
@ -72,7 +72,7 @@ const useData: UseData = (options, input, fetcherFn, swrOptions) => {
})
}
return response
return response as typeof response & { isLoading: boolean }
}
export default useData

View File

@ -12,9 +12,6 @@ const isSwell = provider === 'swell'
const isVendure = provider === 'vendure'
module.exports = withCommerceConfig({
future: {
webpack5: true,
},
commerce,
i18n: {
locales: ['en-US', 'es'],

11033
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -35,27 +35,27 @@
"lodash.debounce": "^4.0.8",
"lodash.random": "^3.2.0",
"lodash.throttle": "^4.1.1",
"next": "10.0.9-canary.5",
"next-seo": "^4.24.0",
"next": "^11.0.0",
"next-seo": "^4.26.0",
"next-themes": "^0.0.14",
"postcss": "^8.3.0",
"postcss": "^8.3.5",
"postcss-nesting": "^8.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-fast-marquee": "^1.1.3",
"react-fast-marquee": "^1.1.4",
"react-merge-refs": "^1.1.0",
"react-use-measure": "^2.0.4",
"shopify-buy": "^2.11.0",
"swell-js": "^4.0.0-next.0",
"swr": "^0.5.6",
"tabbable": "^5.2.0",
"tailwindcss": "^2.1.2"
"tailwindcss": "^2.2.2"
},
"devDependencies": {
"@graphql-codegen/cli": "^1.21.5",
"@graphql-codegen/schema-ast": "^1.18.3",
"@graphql-codegen/typescript": "^1.22.1",
"@graphql-codegen/typescript-operations": "^1.18.0",
"@graphql-codegen/typescript": "^1.22.2",
"@graphql-codegen/typescript-operations": "^1.18.1",
"@next/bundle-analyzer": "^10.2.3",
"@types/body-scroll-lock": "^2.6.1",
"@types/cookie": "^0.4.0",
@ -63,18 +63,18 @@
"@types/lodash.debounce": "^4.0.6",
"@types/lodash.random": "^3.2.6",
"@types/lodash.throttle": "^4.1.6",
"@types/node": "^15.6.1",
"@types/node": "^15.12.4",
"@types/react": "^17.0.8",
"@types/shopify-buy": "^2.10.5",
"deepmerge": "^4.2.2",
"graphql": "^15.5.0",
"graphql": "^15.5.1",
"husky": "^6.0.0",
"lint-staged": "^11.0.0",
"next-unused": "^0.0.6",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-preset-env": "^6.7.0",
"prettier": "^2.3.0",
"typescript": "4.2.4"
"typescript": "4.3.4"
},
"husky": {
"hooks": {

635
yarn.lock

File diff suppressed because it is too large Load Diff