Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove duplicate imports when migrating standalone components #15

Merged
merged 6 commits into from
Oct 12, 2023

Conversation

sean-perkins
Copy link
Contributor

This PR resolves an issue where existing imports to components would be persisted when migrating a standalone component, resulting in duplicate import statements after the migration.

e.g.:

import { IonContent } from "@ionic/angular";

@Component({
  template: `<ion-content></ion-content>`
  standalone: true
})
export class MyComponent {
  @ViewChild(IonContent) content!: IonContent;
}

Resulted in:

import { IonContent } from "@ionic/angular/standalone";
import { IonContent } from "@ionic/angular/standalone";

@Component({
  template: `<ion-content></ion-content>`
  standalone: true,
  imports: [IonContent]
})
export class MyComponent {
  @ViewChild(IonContent) content!: IonContent;
}

This work is split from the reproductions provided in #13

@sean-perkins sean-perkins merged commit 1fb8506 into main Oct 12, 2023
@sean-perkins sean-perkins deleted the sp/updates branch October 12, 2023 16:58
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.

1 participant