Skip to content

Conversation

@SwarnimDoegar
Copy link

No description provided.

@ahnv ahnv requested a review from Copilot December 17, 2025 05:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR represents a major overhaul of the ImageKit Angular SDK, upgrading it from version 5.x to 6.x. The changes include a package rename, API simplification, architectural improvements, and enhanced testing infrastructure.

Key Changes:

  • Package renamed from imagekitio-angular to @imagekit/angular with updated module structure
  • API simplified by removing path parameter (replaced with src), removing publicKey from configuration, and removing LQIP feature
  • Upload component removed in favor of functional upload() API re-exported from core JavaScript SDK
  • New responsive image support enabled by default with automatic srcset generation

Reviewed changes

Copilot reviewed 69 out of 84 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
sdk/package.json Updated package name, version to 6.0.0, dependencies, and build configuration
sdk/src/lib/imagekit-angular.module.ts Renamed module from ImagekitioAngularModule to ImagekitAngularModule, removed upload component
sdk/src/lib/imagekit-angular.service.ts Simplified service to use @imagekit/javascript buildSrc instead of imagekit-javascript SDK
sdk/src/lib/ik-image/ik-image.component.ts Added responsive image support with srcset generation, removed LQIP functionality
sdk/src/lib/ik-video/ik-video.component.ts Replaced path parameter with src, simplified component logic
sdk/src/public-api.ts Updated exports to re-export functions and types from @imagekit/javascript
test-app/ New comprehensive test application demonstrating SDK features with Cypress E2E tests
README.md Extensive documentation updates including migration guide, new upload examples, and API changes
sdk/tests/sdk-tests/ Updated unit tests to reflect API changes and removed upload component tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ahnv
Copy link
Member

ahnv commented Dec 17, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ahnv
Copy link
Member

ahnv commented Dec 17, 2025

@codex review for regressions as part of the overhaul

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 68 out of 83 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

template: `<video></video>`,
})

export class IkVideoComponent implements OnInit {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class should also implement OnChanges and AfterViewInit since we have the functions ngAfterViewInit() and ngOnChanges().

Ref:

  1. https://v17.angular.io/api/core/OnChanges
  2. https://v17.angular.io/api/core/AfterViewInit
Suggested change
export class IkVideoComponent implements OnInit {
export class IkVideoComponent implements OnInit, OnChanges, AfterViewInit {

@Input('queryParameters') queryParameters: QueryParameters;
@Input('loading') loading: string = "lazy";
@Input('width') width: number | string;
@Input('height') height: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If width is number | string, shouldn't this be the same?

Suggested change
@Input('height') height: string;
@Input('height') height: number | string;

this.setElementAttributes(video, attrsToSet);
}

namedNodeMapToObject(source: NamedNodeMap): Dict {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the same function in ik-image component too. Let's extract this to a shared util.

context.setElementAttributes(image, attrsToSet);
}

namedNodeMapToObject(source: NamedNodeMap): Dict {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the same function in ik-video component too. Let's extract this to a shared util.

return target;
};

setElementAttributes(element: any, attributesLiteral: Dict): void {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the same function in ik-video component too. Let's extract this to a shared util.

this.setUrl(options);
}

ngOnChanges(): void {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling lifecycle hooks manually is anti-pattern. Instead, extract the logic in these hooks into separate functions and then call them from both the places.

Ref: https://www.linkedin.com/pulse/why-you-shouldnt-trigger-lifecycle-hooks-manually-prakhar-srivastava-ybxnf/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aye aye

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this

};
this.setUrl(options);
}
ngOnChanges(): void {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling lifecycle hooks manually is anti-pattern. Instead, extract the logic in these hooks into separate functions and then call them from both the places.

Ref: https://www.linkedin.com/pulse/why-you-shouldnt-trigger-lifecycle-hooks-manually-prakhar-srivastava-ybxnf/

this.url = buildSrc(strictOptions);
this.srcset = '';
} else {
const { src: newSrc, srcSet } = getResponsiveImageAttributes({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if this function errors out? We should handle it in try-catch.

const strictOptions = options as SrcOptions;

if (!this.responsive) {
this.url = buildSrc(strictOptions);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if this function errors out? We should handle it in try-catch.

return null;
}
const strictOptions = options as SrcOptions
this.url = buildSrc(strictOptions);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if this function errors out? We should handle it in try-catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants