Skip to content

Nested helpers/subexp are collapsed #84

@tylerturdenpants

Description

@tylerturdenpants

One of the tests from https://github.com/ember-codemods/ember-angle-brackets-codemod/

Before ember-template-recast (correct)

input: 
{{some-component
  people=(array
    (hash
      name="Alex"
      age=5
      nested=(hash oldest=true amount=(format-currency 350 sign="£"))
      disabled=(eq foo "bar")
    )
    (hash name="Ben" age=4)
    (hash name="Sophie" age=1)
  )
}}

output: 
<SomeComponent
  @people={{array
    (hash
      name="Alex"
      age=5
      nested=(hash oldest=true amount=(format-currency 350 sign="£"))
      disabled=(eq foo "bar")
    )
    (hash name="Ben" age=4)
    (hash name="Sophie" age=1)
  }}
/>

After ember-template-recast refactor (incorrect)

input: 
{{some-component
  people=(array
    (hash
      name="Alex"
      age=5
      nested=(hash oldest=true amount=(format-currency 350 sign="£"))
      disabled=(eq foo "bar")
    )
    (hash name="Ben" age=4)
    (hash name="Sophie" age=1)
  )
}}


output: 
<SomeComponent @people={{array (hash name="Alex" age=5 nested=(hash oldest=true amount=(format-currency 350 sign="£")) disabled=(eq foo "bar")) (hash name="Ben" age=4) (hash name="Sophie" age=1)}}></SomeComponent>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions