emberjs / emberjs/ember.js

DX: error message improvement around colliding queryParams

Open
#17,650 0 comments 0 reactions 0 assignees View on GitHub
Query Params Routing
Dominant language
TypeScript
Stars
22.6k
Forks
4.2k
Avg merge
3d 12h
Merged PRs (30d)
15

Description

This error message could stand to be improved

https://github.com/emberjs/ember.js/blob/fe93892b14fe8bba073aaad0e8ce098008f6b222/packages/%40ember/-internals/routing/lib/system/router.ts#L1122-L1128

* the language suggests that the fix should be applied to the controller, but the queryParam config that's suggested must be applied to the child controller's respective route
* prescribing a "fix" here makes some broad assumptions about the desired result
* if we want parent and child both referring to their own qps, but each able to refer to them in templates under the same property name, the advice in the error message is good
* if we want to consume a single queryParam in both parent and child, such that in-place transitions update in both top-level templates, injecting parent controller onto child is probably the advisable solution, and the error message is going to lead developers down the wrong path [twiddle](https://ember-twiddle.com/ee716466d45128292349f8a6a7416ea9?openFiles=routes.parent.js%2C&route=%2Fparent%2Fchild%3Ffoo%3Da)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.