QueryParamsHandling type should be exported
See original GitHub issue#30816 - The reporter closed it but it shouldnβt have been closed.
π bug report
Affected Package
The issue is caused by package @angular/router
Is this a regression?
Yes, the previous version in which this bug was not present was: Angular 7
Description
The QueryParamsHandling type is no longer exposed. All types that are used in public APIs should be exposed to avoid people having to duplicate the type. Previously, it was accessible via @angular/router/src/config.
π¬ Minimal Reproduction
N/A
π₯ Exception or Error
libs/shared/layout/src/lib/ctas/link.model.ts(1,37): error TS2307: Cannot find module '@angular/router/src/config'.
π Your Environment
Angular Version:
Angular CLI: 8.0.1
Node: 10.15.2
OS: darwin x64
Angular: 8.1.0-next.1
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.800.1
@angular-devkit/build-angular 0.800.2
@angular-devkit/build-ng-packagr 0.800.2
@angular-devkit/build-optimizer 0.800.2
@angular-devkit/build-webpack 0.800.2
@angular-devkit/core 8.0.2
@angular-devkit/schematics 8.0.2
@angular/cdk 8.0.0
@angular/cli 8.0.1
@angular/flex-layout 8.0.0-beta.26
@ngtools/json-schema 1.1.0
@ngtools/webpack 8.0.2
@schematics/angular 8.0.2
@schematics/update 0.800.1
ng-packagr 5.3.0
rxjs 6.5.2
typescript 3.4.5
webpack 4.30.0
Anything else relevant?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:10 (8 by maintainers)
Top Results From Across the Web
path/node_modules/@angular/router/router"' has no exported ...
Go to @ angular / router / router "and insert the word 'export' ... export declare type QueryParamsHandling = 'merge' | 'preserve' |...
Read more >QueryParamsHandling - Angular
How to handle query parameters in a router link. One of: "merge" : Merge new parameters with current parameters. "preserve" : Preserve current...
Read more >How to use queryParamsHandling In Angular | Akashminds
QueryParamsHandling is a great way to use Angular to manage parameters in your URL. By using this method, you can easily add, remove,Β ......
Read more >How To Use Query Parameters with Angular Router
To prevent this, you can set queryParamsHandling to either 'preserve' ... export class ProductComponent implements OnInit { order: string;Β ...
Read more >Exp Routing Queryparamshandling - StackBlitz
Starter project for Angular apps that exports to the Angular CLI.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@trotyl Thanks for the APF link.
I would hope that the Angular team wouldnβt recommend inlining types to external teams. Thatβs a dangerous recommendation. We have a lot of junior developers who donβt understand that a type should be created for this and would use that recommendation as an excuse for why they duplicated type information.
I looked at that comment and I donβt think it applies here.
The API name is already public as queryParamsHandling in NavigationExtras. Even if it were still undergoing name changes, itβs super easy to rename a type in a backwards compatible manner.
Anyway, I donβt really care about the semantics of regression/bug. The change is minor and there are at least 3 separate PRs/issues related to it. There were people using the type who now have to duplicate the type in their code. If queryParamsHandling were updated, it would be a full scale refactor to fix the duplicated types (which in our βAgileβ world, would mean a story which means groomingβ¦ donβt ask, itβs frustrating).
Given that the API name is already public and the type is used internally and a name change could easily be done in a backwards compatible manner and that the type was accessible before (whether or not it was a part of the βpublicβ API) and that best practices should be to reuse types instead of copying and that there is a PR already open, I canβt think of a reason why this shouldnβt be merged with haste.
Semantics aside, can you think of any reason to block this?
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.