Skip to content

Deprecate positional arguments and non-block usage of {{link-to}} #614

@chancancode

Description

@chancancode

In #311 we added official named arguments to {{link-to}} (and therefore making <LinkTo> possible). Now that people have had time to migrate (and there are codemods available), it is time to kill the positional arguments api for {{link-to}}.

Reasons:

  1. It's no longer idiomatic, as it is being taught as a component, and components largely don't take positional arguments anymore due to widespread angle-bracket invocation usage (unless they are mimicking "control flows", which {{link-to}} is not)
  2. The positional argument version and the non-block version are implemented via magic AST transforms, making it not "just a regular ember component" and not importable

It would be nice the get on this asap so the deprecation can land before strict mode (#496) lands in a stable release. Otherwise, we will end up in a situation where the "normal" version of <LinkTo> requires an import but the "legacy" form {{link-to}} does not. That will be a while, so we have some time, but still we should start soon.

I would expect that this should also deprecate (query-params) as it is not necessary using the named arguments version.

To be clear, {{#link-to route=... model=...}}...{{/link-to}} would still work, because you can invoke any components with either curly or angle bracket form, but it's the positional arguments mapping that we are talking about here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-frameworkRFCs that impact the ember.js library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions