Skip to content

Commit

Permalink
chore(deps): update peerdependency next to v15 (#705)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Matt Kane <[email protected]>
  • Loading branch information
renovate[bot] and ascorbic authored Oct 26, 2024
1 parent cb40322 commit 98bc64e
Show file tree
Hide file tree
Showing 4 changed files with 461 additions and 415 deletions.
4 changes: 2 additions & 2 deletions examples/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"@types/react": "^18.2.67",
"@types/react-dom": "^18.2.22",
"@unpic/react": "workspace:^",
"next": "^14.1.3",
"next": "^15.0.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"typescript": "^5.4.2"
},
"devDependencies": {
"@netlify/plugin-nextjs": "^5.0.0"
}
}
}
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"@vitejs/plugin-react": "^4.3.2",
"cssstyle": "^4.1.0",
"jsdom": "^25.0.1",
"next": "^14.2.14",
"next": "^15.0.1",
"publint": "^0.2.11",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand All @@ -93,7 +93,7 @@
"@unpic/core": "workspace:^"
},
"peerDependencies": {
"next": "^13.0.0 || ^14.0.0",
"next": "^13.0.0 || ^14.0.0 || ^15.0.0",
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
},
Expand Down
8 changes: 6 additions & 2 deletions packages/react/src/next-legacy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ function checkMatchingPatterns(config: ImageConfigComplete, src: string) {
return;
}

import("next/dist/shared/lib/match-remote-pattern").then(({ hasMatch }) => {
if (!hasMatch(config.domains, config.remotePatterns, parsedSrc)) {
import("next/dist/shared/lib/match-remote-pattern").then((mod) => {
const hasMatch = mod.hasRemoteMatch ?? (mod as any).hasMatch;
if (
hasMatch &&
!hasMatch(config.domains, config.remotePatterns, parsedSrc)
) {
throw new Error(
`[Unpic]: Invalid src (${src}). Images that aren't on a supported image CDN must be configured under images in your \`next.config.js\`\n` +
`See more info: https://nextjs.org/docs/messages/next-image-unconfigured-host`,
Expand Down
Loading

0 comments on commit 98bc64e

Please sign in to comment.