Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate "old class binding" syntax #665

Closed
chancancode opened this issue Sep 28, 2020 · 5 comments
Closed

Deprecate "old class binding" syntax #665

chancancode opened this issue Sep 28, 2020 · 5 comments

Comments

@chancancode
Copy link
Member

chancancode commented Sep 28, 2020

Basically deprecate and remove this file: https://github.com/emberjs/ember.js/blob/aeef923e9f5f7dde2bc43fcdddabc4a3b98769ec/packages/ember-template-compiler/lib/plugins/transform-old-class-binding-syntax.ts

TL;DR deprecate passing classBindings and classNameBindings as arguments when doing curly component invocations, i.e. instead of {{my-component classNameBindings="foo:bar:baz"}}, write {{my-component class=(if this.foo "bar" "baz")}}, or better yet, <MyComponent class={{if this.foo "bar" "baz"}} />.

Note that classBindings and classNameBindings already does not work on angle bracket invocations.

@chancancode
Copy link
Member Author

The classBindings and classNameBindings feature actually supports a lot of weir micro syntax/features, dashififying the class name etc, so we'll need to dig a bit deeper into the tests to catalog what they are and what the map to, but in each case, there is always a reliable mechanical transformation that you can write instead.

@sandstrom
Copy link
Contributor

If curly components are already on their way out (not officially deprecated, but still), isn't it easier to spend effort elsewhere?

(not against the idea in itself though)

@chancancode
Copy link
Member Author

Curly invocations themselves (which can be used to invoke any component) are not necessarily on their way out, they just have different use cases. Curly invocations support passing positional arguments which makes them a better fit for "helper-like" or "control-flow-like" components (which can be implemented using classic components or a custom component manager).

@chriskrycho
Copy link
Contributor

I believe this was done in #691?

@wagenet
Copy link
Member

wagenet commented Jul 23, 2022

Looks like this was completed. If not, it should be part of #832

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants