Skip to content

feat: return if the pop on NavController was successful - #27404

Merged
sean-perkins merged 3 commits into
ionic-team:feature-7.1from
andrzejpindor:27403-return-pop-status-from-nav-controller
May 18, 2023
Merged

sean-perkins merged 3 commits into
ionic-team:feature-7.1from
andrzejpindor:27403-return-pop-status-from-nav-controller

Conversation

@andrzejpindor

@andrzejpindor andrzejpindor commented May 5, 2023 •

Copy link
Copy Markdown
Contributor

Issue number: Resolves #27403


What is the current behavior?

NavController.pop() returns Promise<void>.

What is the new behavior?

NavController.pop() returns Promise<boolean> propagating success/fail from underlying outlet.

Does this introduce a breaking change?

  • Yes
  • No

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions github-actions Bot added the package: angular @ionic/angular package label May 5, 2023
@sean-perkins
sean-perkins changed the base branch from main to feature-7.1 May 18, 2023 16:02
@sean-perkins

Copy link
Copy Markdown
Contributor

CI is failing on the formatting diff with prettier. We will need to run npm run fmt from the angular/ directory.

If you are able to do this, that would be great. Otherwise I can checkout your remote and push the changes directly.

@andrzejpindor

Copy link
Copy Markdown
Contributor Author

CI is failing on the formatting diff with prettier. We will need to run npm run fmt from the angular/ directory.

If you are able to do this, that would be great. Otherwise I can checkout your remote and push the changes directly.

Hi, sorry for that - I fixed formatting using given npm task.

@sean-perkins sean-perkins left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for this contribution 🎉

I updated the base branch to target feature-7.1. While this is a "bug" that the type is incorrect against ion-nav, releasing in a minor will help developers migrate if they are currently strictly typing against the return type.

e.g.:

function foo(): Promise<void> {
  // This will return an error once the type signature changes
  // That is ok - but we will do it in a minor so developers aren't surprised by it
  return this.navCtrl.pop(); 
}

@sean-perkins
sean-perkins merged commit e80f0b2 into ionic-team:feature-7.1 May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: angular @ionic/angular package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants