Attempt to shrink [shot-on] edge function size

This commit is contained in:
Sam Becker 2024-02-21 19:15:55 -06:00
parent 09058282f5
commit 99a6974dd6
3 changed files with 56 additions and 51 deletions

View File

@ -38,7 +38,7 @@
"jest": "^29.7.0", "jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0", "jest-environment-jsdom": "^29.7.0",
"nanoid": "^5.0.6", "nanoid": "^5.0.6",
"next": "14.1.0", "next": "14.1.1-canary.69",
"next-auth": "5.0.0-beta.9", "next-auth": "5.0.0-beta.9",
"next-themes": "^0.2.1", "next-themes": "^0.2.1",
"postcss": "8.4.35", "postcss": "8.4.35",

103
pnpm-lock.yaml generated
View File

@ -46,7 +46,7 @@ dependencies:
version: 7.0.2(eslint@8.56.0)(typescript@5.3.3) version: 7.0.2(eslint@8.56.0)(typescript@5.3.3)
'@vercel/analytics': '@vercel/analytics':
specifier: ^1.2.2 specifier: ^1.2.2
version: 1.2.2(next@14.1.0)(react@18.2.0) version: 1.2.2(next@14.1.1-canary.69)(react@18.2.0)
'@vercel/blob': '@vercel/blob':
specifier: ^0.22.1 specifier: ^0.22.1
version: 0.22.1 version: 0.22.1
@ -55,7 +55,7 @@ dependencies:
version: 0.7.2 version: 0.7.2
'@vercel/speed-insights': '@vercel/speed-insights':
specifier: ^1.0.10 specifier: ^1.0.10
version: 1.0.10(next@14.1.0)(react@18.2.0) version: 1.0.10(next@14.1.1-canary.69)(react@18.2.0)
autoprefixer: autoprefixer:
specifier: 10.4.17 specifier: 10.4.17
version: 10.4.17(postcss@8.4.35) version: 10.4.17(postcss@8.4.35)
@ -93,14 +93,14 @@ dependencies:
specifier: ^5.0.6 specifier: ^5.0.6
version: 5.0.6 version: 5.0.6
next: next:
specifier: 14.1.0 specifier: 14.1.1-canary.69
version: 14.1.0(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0) version: 14.1.1-canary.69(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0)
next-auth: next-auth:
specifier: 5.0.0-beta.9 specifier: 5.0.0-beta.9
version: 5.0.0-beta.9(next@14.1.0)(react@18.2.0) version: 5.0.0-beta.9(next@14.1.1-canary.69)(react@18.2.0)
next-themes: next-themes:
specifier: ^0.2.1 specifier: ^0.2.1
version: 0.2.1(next@14.1.0)(react-dom@18.2.0)(react@18.2.0) version: 0.2.1(next@14.1.1-canary.69)(react-dom@18.2.0)(react@18.2.0)
postcss: postcss:
specifier: 8.4.35 specifier: 8.4.35
version: 8.4.35 version: 8.4.35
@ -1563,8 +1563,8 @@ packages:
- utf-8-validate - utf-8-validate
dev: false dev: false
/@next/env@14.1.0: /@next/env@14.1.1-canary.69:
resolution: {integrity: sha512-Py8zIo+02ht82brwwhTg36iogzFqGLPXlRGKQw5s+qP/kMNc4MAyDeEwBKDijk6zTIbegEgu8Qy7C1LboslQAw==} resolution: {integrity: sha512-R9JWNDWRKXxjt5DSOiTNOFXnp9TuDv3CaHvXLILiK5s/y0W2v7I2hsza7TKU36R1hWE1wv+hqq/IGMd/U5kM+g==}
dev: false dev: false
/@next/eslint-plugin-next@14.1.0: /@next/eslint-plugin-next@14.1.0:
@ -1573,8 +1573,8 @@ packages:
glob: 10.3.10 glob: 10.3.10
dev: false dev: false
/@next/swc-darwin-arm64@14.1.0: /@next/swc-darwin-arm64@14.1.1-canary.69:
resolution: {integrity: sha512-nUDn7TOGcIeyQni6lZHfzNoo9S0euXnu0jhsbMOmMJUBfgsnESdjN97kM7cBqQxZa8L/bM9om/S5/1dzCrW6wQ==} resolution: {integrity: sha512-YhNjK/rW+dLNBCQkCTQ/td+CuiC7Cjf7P72FZQLoWf552JxWBDWHCb/AoppeXNHhlCJAR8bEow8UU9WUzXNP0A==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [darwin] os: [darwin]
@ -1582,8 +1582,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-darwin-x64@14.1.0: /@next/swc-darwin-x64@14.1.1-canary.69:
resolution: {integrity: sha512-1jgudN5haWxiAl3O1ljUS2GfupPmcftu2RYJqZiMJmmbBT5M1XDffjUtRUzP4W3cBHsrvkfOFdQ71hAreNQP6g==} resolution: {integrity: sha512-tOyHQqsKCYNXqxnQHdR+M13QaDx+/pOgz6//H0JhoVN1/wieWg65Z18ngJfqe1iq9XINjI3XsIPiWaNrPLiNoA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [darwin] os: [darwin]
@ -1591,8 +1591,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-linux-arm64-gnu@14.1.0: /@next/swc-linux-arm64-gnu@14.1.1-canary.69:
resolution: {integrity: sha512-RHo7Tcj+jllXUbK7xk2NyIDod3YcCPDZxj1WLIYxd709BQ7WuRYl3OWUNG+WUfqeQBds6kvZYlc42NJJTNi4tQ==} resolution: {integrity: sha512-tXh5rctbRDBwpRdEwy/8MhVOT/V9YrOuDXjS2Aq38ze0MX11V3qDIfg8yDqHxwrOfpBxaa1n9J6t/WEADErCWw==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
@ -1600,8 +1600,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-linux-arm64-musl@14.1.0: /@next/swc-linux-arm64-musl@14.1.1-canary.69:
resolution: {integrity: sha512-v6kP8sHYxjO8RwHmWMJSq7VZP2nYCkRVQ0qolh2l6xroe9QjbgV8siTbduED4u0hlk0+tjS6/Tuy4n5XCp+l6g==} resolution: {integrity: sha512-vbyyLskTM67Z/YXUtU8Qy7ly1zssvsbEeE2eyfu6zdvFoUeG7InVE1NsnRXU9W7w/ekK9CS44jtGGznsT/Qt9w==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
@ -1609,8 +1609,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-linux-x64-gnu@14.1.0: /@next/swc-linux-x64-gnu@14.1.1-canary.69:
resolution: {integrity: sha512-zJ2pnoFYB1F4vmEVlb/eSe+VH679zT1VdXlZKX+pE66grOgjmKJHKacf82g/sWE4MQ4Rk2FMBCRnX+l6/TVYzQ==} resolution: {integrity: sha512-oiK5K6NY3OtxxJXJJykgPDWbuBcgd4HJI3YL8f+UaifiJQSnqqZTzDQvdVS4FY84uES3moH1JjXHJbg9AUN/Qw==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
@ -1618,8 +1618,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-linux-x64-musl@14.1.0: /@next/swc-linux-x64-musl@14.1.1-canary.69:
resolution: {integrity: sha512-rbaIYFt2X9YZBSbH/CwGAjbBG2/MrACCVu2X0+kSykHzHnYH5FjHxwXLkcoJ10cX0aWCEynpu+rP76x0914atg==} resolution: {integrity: sha512-nkm36Js4zh4tzVmRxc4jgDGaAYhGqd8DCaih17/hryD9ghxvK5gMWuHgLjCmFf/4K0mVL6CX0quRle0lP9zGZg==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
@ -1627,8 +1627,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-win32-arm64-msvc@14.1.0: /@next/swc-win32-arm64-msvc@14.1.1-canary.69:
resolution: {integrity: sha512-o1N5TsYc8f/HpGt39OUQpQ9AKIGApd3QLueu7hXk//2xq5Z9OxmV6sQfNp8C7qYmiOlHYODOGqNNa0e9jvchGQ==} resolution: {integrity: sha512-UymXQvAYAMqfmrcW/S5SGC0R3aq6m3kLi6R+z5KlYSFBOGa9Or2A4n7/JRbn4GWB86R+PS3NruquAgCtWZU/mQ==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [win32] os: [win32]
@ -1636,8 +1636,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-win32-ia32-msvc@14.1.0: /@next/swc-win32-ia32-msvc@14.1.1-canary.69:
resolution: {integrity: sha512-XXIuB1DBRCFwNO6EEzCTMHT5pauwaSj4SWs7CYnME57eaReAKBXCnkUE80p/pAZcewm7hs+vGvNqDPacEXHVkw==} resolution: {integrity: sha512-mBO+yc2SqqHiEYinP7vQczgg4L9GPSIpwaKJ9xLPcEtAQ4VlGUIZCFFL+zSN44EZNnCjHMz5MaGuFidLc3j8/w==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [ia32] cpu: [ia32]
os: [win32] os: [win32]
@ -1645,8 +1645,8 @@ packages:
dev: false dev: false
optional: true optional: true
/@next/swc-win32-x64-msvc@14.1.0: /@next/swc-win32-x64-msvc@14.1.1-canary.69:
resolution: {integrity: sha512-9WEbVRRAqJ3YFVqEZIxUqkiO8l1nool1LmNxygr5HWF8AcSYsEpneUDhmjUVJEzO2A04+oPtZdombzzPPkTtgg==} resolution: {integrity: sha512-kv29K09RRG+OQC+svrWKVWGjTP8JeXnwesymXFI+b2BsTPIXRRv60V0FEINhzj61mTI+Dr7M4qL9lQJ8fkHtrQ==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
@ -2817,9 +2817,14 @@ packages:
tslib: 2.6.2 tslib: 2.6.2
dev: false dev: false
/@swc/helpers@0.5.2: /@swc/counter@0.1.3:
resolution: {integrity: sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==} resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==}
dev: false
/@swc/helpers@0.5.5:
resolution: {integrity: sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==}
dependencies: dependencies:
'@swc/counter': 0.1.3
tslib: 2.6.2 tslib: 2.6.2
dev: false dev: false
@ -3238,7 +3243,7 @@ packages:
resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
dev: false dev: false
/@vercel/analytics@1.2.2(next@14.1.0)(react@18.2.0): /@vercel/analytics@1.2.2(next@14.1.1-canary.69)(react@18.2.0):
resolution: {integrity: sha512-X0rctVWkQV1e5Y300ehVNqpOfSOufo7ieA5PIdna8yX/U7Vjz0GFsGf4qvAhxV02uQ2CVt7GYcrFfddXXK2Y4A==} resolution: {integrity: sha512-X0rctVWkQV1e5Y300ehVNqpOfSOufo7ieA5PIdna8yX/U7Vjz0GFsGf4qvAhxV02uQ2CVt7GYcrFfddXXK2Y4A==}
peerDependencies: peerDependencies:
next: '>= 13' next: '>= 13'
@ -3249,7 +3254,7 @@ packages:
react: react:
optional: true optional: true
dependencies: dependencies:
next: 14.1.0(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0) next: 14.1.1-canary.69(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
server-only: 0.0.1 server-only: 0.0.1
dev: false dev: false
@ -3274,7 +3279,7 @@ packages:
ws: 8.14.2(bufferutil@4.0.8)(utf-8-validate@6.0.3) ws: 8.14.2(bufferutil@4.0.8)(utf-8-validate@6.0.3)
dev: false dev: false
/@vercel/speed-insights@1.0.10(next@14.1.0)(react@18.2.0): /@vercel/speed-insights@1.0.10(next@14.1.1-canary.69)(react@18.2.0):
resolution: {integrity: sha512-4uzdKB0RW6Ff2FkzshzjZ+RlJfLPxgm/00i0XXgxfMPhwnnsk92YgtqsxT9OcPLdJUyVU1DqFlSWWjIQMPkh0g==} resolution: {integrity: sha512-4uzdKB0RW6Ff2FkzshzjZ+RlJfLPxgm/00i0XXgxfMPhwnnsk92YgtqsxT9OcPLdJUyVU1DqFlSWWjIQMPkh0g==}
requiresBuild: true requiresBuild: true
peerDependencies: peerDependencies:
@ -3298,7 +3303,7 @@ packages:
vue-router: vue-router:
optional: true optional: true
dependencies: dependencies:
next: 14.1.0(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0) next: 14.1.1-canary.69(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
dev: false dev: false
@ -6189,7 +6194,7 @@ packages:
resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
dev: false dev: false
/next-auth@5.0.0-beta.9(next@14.1.0)(react@18.2.0): /next-auth@5.0.0-beta.9(next@14.1.1-canary.69)(react@18.2.0):
resolution: {integrity: sha512-BWFiwJ/wzfxWpHnGpAoFsXHSlVofWgFns6tjtIGeDrXfEf3D+afnBpmzCNyek2RNYDVgMHi8Q5uXzFoNBd2l5g==} resolution: {integrity: sha512-BWFiwJ/wzfxWpHnGpAoFsXHSlVofWgFns6tjtIGeDrXfEf3D+afnBpmzCNyek2RNYDVgMHi8Q5uXzFoNBd2l5g==}
peerDependencies: peerDependencies:
'@simplewebauthn/browser': ^9.0.1 '@simplewebauthn/browser': ^9.0.1
@ -6206,24 +6211,24 @@ packages:
optional: true optional: true
dependencies: dependencies:
'@auth/core': 0.26.3 '@auth/core': 0.26.3
next: 14.1.0(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0) next: 14.1.1-canary.69(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
dev: false dev: false
/next-themes@0.2.1(next@14.1.0)(react-dom@18.2.0)(react@18.2.0): /next-themes@0.2.1(next@14.1.1-canary.69)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-B+AKNfYNIzh0vqQQKqQItTS8evEouKD7H5Hj3kmuPERwddR2TxvDSFZuTj6T7Jfn1oyeUyJMydPl1Bkxkh0W7A==} resolution: {integrity: sha512-B+AKNfYNIzh0vqQQKqQItTS8evEouKD7H5Hj3kmuPERwddR2TxvDSFZuTj6T7Jfn1oyeUyJMydPl1Bkxkh0W7A==}
peerDependencies: peerDependencies:
next: '*' next: '*'
react: '*' react: '*'
react-dom: '*' react-dom: '*'
dependencies: dependencies:
next: 14.1.0(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0) next: 14.1.1-canary.69(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/next@14.1.0(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0): /next@14.1.1-canary.69(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-wlzrsbfeSU48YQBjZhDzOwhWhGsy+uQycR8bHAOt1LY1bn3zZEcDyHQOEoN3aWzQ8LHCAJ1nqrWCc9XF2+O45Q==} resolution: {integrity: sha512-9R5upfn+uTNtLTT+OQqQyGPtethX+UV6Xn9mIxhB/h10aBV4DZGKEubJ6mBnyB96OCAA/20G3li1VmxQd7cFOQ==}
engines: {node: '>=18.17.0'} engines: {node: '>=18.17.0'}
hasBin: true hasBin: true
peerDependencies: peerDependencies:
@ -6237,8 +6242,8 @@ packages:
sass: sass:
optional: true optional: true
dependencies: dependencies:
'@next/env': 14.1.0 '@next/env': 14.1.1-canary.69
'@swc/helpers': 0.5.2 '@swc/helpers': 0.5.5
busboy: 1.6.0 busboy: 1.6.0
caniuse-lite: 1.0.30001585 caniuse-lite: 1.0.30001585
graceful-fs: 4.2.11 graceful-fs: 4.2.11
@ -6247,15 +6252,15 @@ packages:
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
styled-jsx: 5.1.1(@babel/core@7.23.9)(react@18.2.0) styled-jsx: 5.1.1(@babel/core@7.23.9)(react@18.2.0)
optionalDependencies: optionalDependencies:
'@next/swc-darwin-arm64': 14.1.0 '@next/swc-darwin-arm64': 14.1.1-canary.69
'@next/swc-darwin-x64': 14.1.0 '@next/swc-darwin-x64': 14.1.1-canary.69
'@next/swc-linux-arm64-gnu': 14.1.0 '@next/swc-linux-arm64-gnu': 14.1.1-canary.69
'@next/swc-linux-arm64-musl': 14.1.0 '@next/swc-linux-arm64-musl': 14.1.1-canary.69
'@next/swc-linux-x64-gnu': 14.1.0 '@next/swc-linux-x64-gnu': 14.1.1-canary.69
'@next/swc-linux-x64-musl': 14.1.0 '@next/swc-linux-x64-musl': 14.1.1-canary.69
'@next/swc-win32-arm64-msvc': 14.1.0 '@next/swc-win32-arm64-msvc': 14.1.1-canary.69
'@next/swc-win32-ia32-msvc': 14.1.0 '@next/swc-win32-ia32-msvc': 14.1.1-canary.69
'@next/swc-win32-x64-msvc': 14.1.0 '@next/swc-win32-x64-msvc': 14.1.1-canary.69
transitivePeerDependencies: transitivePeerDependencies:
- '@babel/core' - '@babel/core'
- babel-plugin-macros - babel-plugin-macros

View File

@ -1,4 +1,4 @@
import { Photo } from '@/photo'; import type { Photo } from '@/photo';
import { parameterize } from '@/utility/string'; import { parameterize } from '@/utility/string';
const CAMERA_PLACEHOLDER: Camera = { make: 'Camera', model: 'Model' }; const CAMERA_PLACEHOLDER: Camera = { make: 'Camera', model: 'Model' };