-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: parameterized routes do not play animations or set props on vue 3.4+ #28774
Comments
Thanks for the issue! This issue has been labeled as |
Hi there, Can you please create a reproduction of the issue that includes only the code required to reproduce the problem? |
Thanks for the issue! This issue has been labeled as 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. |
https://github.com/lvzhenbo/ionic-vue3.4 There are two commits here, the latest commit is the incorrect case and the penultimate commit is the correct case. Then it's a matter of clicking on the selection bar to switch routes, and you'll see some one page will refresh and the other won't |
I was creating the demo and realized that it may have nothing to do with the vue version update and everything to do with the @vitejs/plugin-vue version update
|
Updating from Vue 3.3.13 to Vue 3.4.4 causes the issue to appear. However, I'm still able to reproduce the issue if I remove Ionic Framework from the application. Have you tried reporting this to the Vue team? |
For vue-router this anomaly is instead normal. Related documentation: https://router.vuejs.org/guide/essentials/dynamic-matching.html#Reacting-to-Params-Changes So I'm guessing that ionic has a workaround for this situation, which is now broken due to a vue version upgrade |
Confirmed that downgrading my project from vue 3.4 to 3.3 resolved this issue. I was not able to find a workaround so that I could stay on 3.4. It seems vue-router's |
We had a similar experience. When upgrading to vue 3.4.5 it started to reuse components when routing between two paths using same route with different params ( To me it seems like vue is following the vue-router documentation:
|
Interested in knowing when this will be solved. Is this a vue issue, or is this that the ionic-vue-router should be updated to conform to the new vue-router ? |
I'm looking into this, but I don't have a good answer at the moment other than that the expected behavior should work. My initial investigation revealed that this ionic-framework/packages/vue/src/components/IonRouterOutlet.ts Lines 69 to 70 in ad65824
Doing If you need a resolution sooner then I recommend downgrading to Vue 3.3.x for now. |
It appears this new behavior is due to a breaking change in Vue: vuejs/core#9916 (comment) The commit for this has been reverted because it was a bigger breaking change than the team expected: vuejs/core#9965 (comment) It sounds like this was already released, so maybe there's something else causing an issue too. |
From the changelog, is it related to this pr (vuejs/core#5912) ? |
Yeah that looks like it is related too. I'll start looking into how we can mitigate this inside of Ionic. |
Can everyone try the following dev build and let me know if the issue is resolved in their apps with Vue 3.4+?
If you're using Vite you might need to remove |
https://github.com/lvzhenbo/ionic-vue3.4 |
Confirmed. That dev build works with |
Nice! Will this be released in the next ionic update? |
I can confirm as well, fixed the issue for me. |
Issue number: resolves #28774 --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> There are two issues causing Ionic Vue apps to not behave as intended with certain versions of Vue: 1. In Vue 3.3 a [breaking change shipped](vuejs/core#9916) that changes the default behavior of the `watch` inside of IonRouterOutlet to be a shallow watcher instead of a deep watcher. This caused the router outlet to not consistent re-render. While the change was later reverted by the Vue team, they expressed that the change [may re-land in a future minor release](vuejs/core#9965 (comment)). As a result, we will need to account for this inside of Ionic. 2. In Vue 3.2 a [custom elements improvement shipped](https://github.com/vuejs/core/blob/main/changelogs/CHANGELOG-3.2.md#3238-2022-08-30) that changed how custom elements are referred to in VNodes. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - The affected `watch` call now is now explicitly a deep watcher. This change is backwards compatible as well as forward compatible with upcoming Vue changes. - Updated IonTabs to account for the new VNode behavior for custom elements. Ionic still supports version of Vue that do not have this improvement, so we need to account for both behaviors for now. I also added a tech debt ticket to remove the old checks when we drop support for older versions of Vue. - Updated E2E test dependencies. During this update some of our tests needed to be updated to account for newer versions of Vue/Vitest. Overall I was able to simplify a lot of our tests as a result. I plan to add renovatebot to these E2E test apps, but I will handle that in a separate PR. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 4. Update the BREAKING.md file with the breaking change. 5. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Dev build: `7.6.6-dev.11705526292.1bc0acb5` Note: Both of the issues cause tests to fail when using the latest dependencies in the Vue E2E test app. However, I need to use the latest dependencies so I can demonstrate that my changes do fix the reported issues. As a result, I have both fixes in the same PR.
Thanks for the issue. This has been resolved via #28846, and a fix will be available in an upcoming release of Ionic Framework. |
Thanks! Do you know when the release will be shipped? |
The bug fix will follow our patch release schedule: https://ionicframework.com/docs/reference/versioning#release-schedule |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
The inability to jump is simply the original behavior of the vue-router
Expected Behavior
Should have jumped.
Steps to Reproduce
Update vue to 3.4, update @vitejs/plugin-vue to 5.0
Code Reproduction URL
https://github.com/lvzhenbo/tsdm-app/tree/652cd1de3281772d6bdd2642d37b73567918efbc
Ionic Info
[WARN] Error loading @capacitor/ios package.json: Error: Cannot find module '@capacitor/ios/package.json'
Ionic:
Ionic CLI : 7.2.0
Ionic Framework : @ionic/vue 7.6.2
Capacitor:
Capacitor CLI : 5.6.0
@capacitor/android : 5.6.0
@capacitor/core : 5.6.0
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run : not installed globally
System:
NodeJS : v20.9.0 (C:\Program Files\nodejs\node.exe)
npm : 10.1.0
OS : Windows 10
Additional Information
No response
The text was updated successfully, but these errors were encountered: