build performance improvements (#384)

* performance improvements

* enable incremental typechecking

* upgrade dependencies

* remove unused dependencies
This commit is contained in:
Tobias Koppers 2021-06-22 21:37:44 +02:00 committed by GitHub
parent 559451f958
commit 1a50be125a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 448 additions and 11975 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

@ -7,7 +7,7 @@
"start": "next start",
"analyze": "BUNDLE_ANALYZE=both yarn build",
"prettier-fix": "prettier --write .",
"find:unused": "next-unused",
"find:unused": "npx next-unused",
"generate": "graphql-codegen",
"generate:shopify": "DOTENV_CONFIG_PATH=./.env.local graphql-codegen -r dotenv/config --config framework/shopify/codegen.json",
"generate:vendure": "graphql-codegen --config framework/vendure/codegen.json",
@ -23,39 +23,35 @@
"@vercel/fetch": "^6.1.0",
"autoprefixer": "^10.2.6",
"body-scroll-lock": "^3.1.5",
"bowser": "^2.11.0",
"classnames": "^2.3.1",
"cookie": "^0.4.1",
"dot-object": "^2.1.4",
"email-validator": "^2.0.4",
"immutability-helper": "^3.1.1",
"isomorphic-unfetch": "^3.1.0",
"js-cookie": "^2.2.1",
"keen-slider": "^5.4.1",
"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 +59,16 @@
"@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": {

View File

@ -34,6 +34,7 @@ module.exports = {
resolveJsonModule: true,
isolatedModules: true,
jsx: 'preserve',
incremental: true,
paths: {
'@lib/*': ['lib/*'],
'@utils/*': ['utils/*'],

View File

@ -14,6 +14,7 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"paths": {
"@lib/*": ["lib/*"],
"@utils/*": ["utils/*"],

1349
yarn.lock

File diff suppressed because it is too large Load Diff