ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.02k stars 13.51k forks source link

bug: Properties `ionNavWillChange` and `ionNavDidChange` do not exist on `IonNav` #28863

Closed projectormato closed 8 months ago

projectormato commented 9 months ago

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

Using Ionic version 7.5.0 or later, this code cause an error:

export interface HogeHogeNav {
    readonly navWillChange: IonNav['ionNavWillChange'];
    readonly navDidChange: IonNav['ionNavDidChange'];
}

The error message is:

Error TS2339: Property 'ionNavWillChange' does not exist on type 'IonNav'.
readonly navWillChange: IonNav['ionNavWillChange'];

Expected Behavior

No error if possible

Steps to Reproduce

  1. Write this code
    export interface HogeHogeNav {
    readonly navWillChange: IonNav['ionNavWillChange'];
    readonly navDidChange: IonNav['ionNavDidChange'];
    }
  2. run npm run build

Code Reproduction URL

No response

Ionic Info

Ionic:

   Ionic CLI                     : 7.2.0
   Ionic Framework               : @ionic/angular 7.5.0
   @angular-devkit/build-angular : 15.2.9
   @angular-devkit/schematics    : 15.2.9
   @angular/cli                  : 15.2.9
   @ionic/angular-toolkit        : 7.0.0

Cordova:

   Cordova CLI       : not installed
   Cordova Platforms : not available
   Cordova Plugins   : not available

Utility:

   cordova-res : not installed globally
   native-run  : not installed globally

System:

   ios-sim : 8.0.2
   NodeJS  : v18.17.0
   npm     : 9.6.7
   OS      : macOS Unknown
   Xcode   : Xcode 15.0.1 Build version 15A507

Additional Information

In versions prior to 7.5.0, the IonNav interface was implemented like this:

export declare interface IonNav extends Components.IonNav {
  /**
   * Event fired when the nav will change components
   */
  ionNavWillChange: EventEmitter<CustomEvent<void>>;
  /**
   * Event fired when the nav has changed components
   */
  ionNavDidChange: EventEmitter<CustomEvent<void>>;
}

diff: https://github.com/ionic-team/ionic-framework/pull/28311/files#diff-1fd76195dbb521bd6fc15558ddb677c06cd4a94d7541ecdea25409b875ea71daL1419-L1428

in version 7.5.0 and later, the implementation seems to have changed to:

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export declare interface IonNav extends Components.IonNav {}

diff: https://github.com/ionic-team/ionic-framework/pull/28311/files#diff-d84d2a25aef8d8c26050fe026186e82c53be36a44acd0c4343af76a671dfb58dR25-R26

Was this removal of ionNavWillChange and ionNavDidChange to IonNav interface intentional?

ionitron-bot[bot] commented 9 months ago

Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

Please reproduce this issue in an Ionic starter application and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

For a guide on how to create a good reproduction, see our Contributing Guide.

averyjohnston commented 8 months ago

This issue is being closed due to insufficient reproduction. If this is still a problem in the latest version of Ionic, please open a new issue and ensure the template is fully filled out. Thank you!