Skip to content

Commit 25d2228

Browse files
authored
feat: Updates URL Loader, Fixes Comma Encoding (#415)
# Description Pulls in the URL Loader update, which itself pulls in the updated URL Gen SDK that addresses comma issues. This makes some fixes that needed to be addressed from the migration to the new URL Loader major release. ## Issue Ticket Number Fixes #414 <!-- Specify above which issue this fixes by referencing the issue number (`#<ISSUE_NUMBER>`) or issue URL. --> <!-- Example: Fixes https://github.com/cloudinary-community/next-cloudinary/issues/<ISSUE_NUMBER> --> ## Type of change <!-- Please select all options that are applicable. --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Fix or improve the documentation - [ ] This change requires a documentation update # Checklist <!-- These must all be followed and checked. --> - [ ] I have followed the contributing guidelines of this project as mentioned in [CONTRIBUTING.md](/CONTRIBUTING.md) - [ ] I have created an [issue](https://github.com/cloudinary-community/next-cloudinary/issues) ticket for this PR - [ ] I have checked to ensure there aren't other open [Pull Requests](https://github.com/cloudinary-community/next-cloudinary/pulls) for the same update/change? - [ ] I have performed a self-review of my own code - [ ] I have run tests locally to ensure they all pass - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes needed to the documentation
1 parent 7c171c9 commit 25d2228

File tree

6 files changed

+1597
-41
lines changed

6 files changed

+1597
-41
lines changed

next-cloudinary/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"test:app": "NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=\"test\" yarn build && cd tests/nextjs-app && yarn build"
1616
},
1717
"dependencies": {
18-
"@cloudinary-util/url-loader": "^3.22.0",
18+
"@cloudinary-util/url-loader": "^4.1.1",
1919
"@cloudinary-util/util": "^2.3.0"
2020
},
2121
"devDependencies": {

next-cloudinary/src/components/CldImage/CldImage.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ const CldImage = forwardRef<HTMLImageElement, CldImageProps>(function CldImage(p
2626
'assetType',
2727
];
2828

29-
transformationPlugins.forEach(({ props = [] }) => {
30-
props.forEach(prop => {
29+
transformationPlugins.forEach(({ props }) => {
30+
const pluginProps = Object.keys(props);
31+
pluginProps.forEach(prop => {
3132
if ( CLD_OPTIONS.includes(prop) ) {
3233
throw new Error(`Option ${prop} already exists!`);
3334
}

next-cloudinary/src/helpers/getCldImageUrl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import {checkForCloudName} from "../lib/cloudinary";
88
* getCldImageUrl
99
*/
1010

11-
export interface GetCldImageUrlOptions extends ImageOptions {};
12-
export interface GetCldImageUrlConfig extends ConfigOptions {};
13-
export interface GetCldImageUrlAnalytics extends AnalyticsOptions {};
11+
export type GetCldImageUrlOptions = ImageOptions;
12+
export type GetCldImageUrlConfig = ConfigOptions;
13+
export type GetCldImageUrlAnalytics = AnalyticsOptions;
1414

1515
// @deprecated GetCldImageUrl
1616
export interface GetCldImageUrl {

next-cloudinary/src/helpers/getCldOgImageUrl.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import type { GetCldImageUrl, GetCldImageUrlOptions } from './getCldImageUrl';
88
*/
99

1010
// @deprecated GetCldOgImageUrl
11-
export interface GetCldOgImageUrl extends GetCldImageUrl {}
11+
export type GetCldOgImageUrl = GetCldImageUrl;
1212

13-
export interface GetCldOgImageUrlOptions extends GetCldImageUrlOptions {};
13+
export type GetCldOgImageUrlOptions = GetCldImageUrlOptions;
1414

1515
export function getCldOgImageUrl(options: GetCldOgImageUrlOptions) {
1616
return getCldImageUrl({

next-cloudinary/src/helpers/getCldVideoUrl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import {checkForCloudName} from "../lib/cloudinary";
88
* getCldVideoUrl
99
*/
1010

11-
export interface GetCldVideoUrlOptions extends VideoOptions {};
12-
export interface GetCldVideoUrlConfig extends ConfigOptions {};
13-
export interface GetCldVideoUrlAnalytics extends AnalyticsOptions {};
11+
export type GetCldVideoUrlOptions = VideoOptions;
12+
export type GetCldVideoUrlConfig = ConfigOptions;
13+
export type GetCldVideoUrlAnalytics = AnalyticsOptions;
1414

1515
export function getCldVideoUrl(options: GetCldVideoUrlOptions, config?: GetCldVideoUrlConfig, analytics?: GetCldVideoUrlAnalytics) {
1616
const cloudName = config?.cloud?.cloudName ?? process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME;

0 commit comments

Comments
 (0)