Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: internal
What is the current behavior?
Currently,
packages/vueandpackages/vue-routerare the only framework packages that don't setstrict, and neither setsrootDir. Turningstricton surfaces 61 pre-existing errors, 41 in@ionic/vue(24 of them inIonTabBar) and 20 in@ionic/vue-router.Nothing reports them today. The rollup build prints type errors as
(!) Plugin typescript:warnings and still exits 0, and there's notsc --noEmitstep in either CI action, so a type error cannot fail a build.Two of the errors are actual bugs, which I went ahead and fixed here.
What is the new behavior?
Both packages now set
strictandrootDir: "src"and typecheck clean. Most of the 61 fixes are null guards and signatures that were lying about what they returned.getTabsHistorywas declared(tab: string) => RouteInfo[]but everything using this was already treating it asstring | undefinedanyway.tabs: {}inIonTabBar's data inferred{}rather than theTabStateinterface already declared in the same file._tabsWillChangeand_tabsDidChangewere initialized to a Vue prop-descriptor object instead of a function, which is why calling them wasn't type-safe.Changing
rootDirdidn't do actually anything here, it just makes us consistent.@rollup/plugin-typescriptalready inferssrcas the common root, and I verifieddist/for both packages with and without it to confirm nothing changed.Both bugs above are fixed.
One behavior change worth calling out: Pressing back with no
defaultHrefand nothing in history used to callrouter.replace(undefined), which vue-router resolves against the current location and then rejects asNAVIGATION_DUPLICATED, so it already did nothing. That path now returns without navigating, matching@ionic/react-router, and it also clears the pop/backincomingRouteParamsthat the old code left staged for the next navigation to pick up.ion-back-buttonalso reads thebackButtonDefaultHrefconfig now. Core resolves that config itself and only renders the button once it has a href, so a config-only back button was previously visible but did nothing.CI now runs a
typecheckscript in bothbuild-vueandbuild-vue-router, between lint and build, preventing us from having to do this cleanup again in the future.Does this introduce a breaking change?
Other information
This will conflict with @thetaPC's PR, #31280. I'm okay waiting for that one to merge and then resolving the issues, though.