Skip to content

Commit 63f7e49

Browse files
committed
Remove deprecated automatic attribute binding
1 parent 83cc8b2 commit 63f7e49

File tree

7 files changed

+4
-400
lines changed

7 files changed

+4
-400
lines changed

README.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ Features
2020
- Removes properties starting with `data-test-` from your JS objects like
2121
component classes for production builds
2222

23-
- Automatically binds properties starting with `data-test-` on all components
24-
for development/testing builds
25-
2623
More information on why that is useful are available on our
2724
[blog](http://simplabs.com/blog/2016/03/04/ember-test-selectors.html)!
2825

@@ -79,20 +76,6 @@ be applied to the element that has `...attributes` on it, or on the component
7976
wrapper `div` element if you don't use `tagName = ''`.
8077

8178

82-
### Usage with Curly Components
83-
84-
If you still use the old curly invocation syntax for components you can pass
85-
`data-test-*` arguments to the components and they will automatically be bound
86-
on the wrapper element too:
87-
88-
```handlebars
89-
{{spinner color="blue" data-test-spinner=true}}
90-
```
91-
92-
Please note that the automatic argument binding only works for components based
93-
on `@ember/component`, but not `@glimmer/component`.
94-
95-
9679
### Usage in Ember addons
9780

9881
If you want to use ember-test-selectors in an addon make sure that it appears

addon/utils/bind-data-test-attributes.js

Lines changed: 0 additions & 79 deletions
This file was deleted.

index.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ module.exports = {
2626
this._stripTestSelectors = !app.tests;
2727
}
2828

29-
this._shouldPatchClassicComponent = !this._stripTestSelectors && addonOptions.patchClassicComponent !== false;
29+
if ('patchClassicComponent' in addonOptions) {
30+
ui.writeDeprecateLine('[ember-test-selectors] The `patchClassicComponent` option is obsolete. ' +
31+
'You can remove it from your `ember-cli-build.js` file.', false);
32+
}
3033
},
3134

3235
_setupPreprocessorRegistry(registry) {
@@ -70,10 +73,6 @@ module.exports = {
7073

7174
this._registeredWithBabel = true;
7275
}
73-
74-
if (this._shouldPatchClassicComponent) {
75-
host.import('vendor/ember-test-selectors/patch-component.js');
76-
}
7776
},
7877

7978
cacheKeyForTree(treeType) {
@@ -85,13 +84,6 @@ module.exports = {
8584
}
8685
},
8786

88-
treeForAddon() {
89-
// remove our "addon" folder from the build if we're stripping test selectors
90-
if (this._shouldPatchClassicComponent) {
91-
return this._super.treeForAddon.apply(this, arguments);
92-
}
93-
},
94-
9587
preprocessTree(type, tree) {
9688
// remove the unit tests if we're testing ourself and are in strip mode.
9789
// we do this because these tests depend on the "addon" and "app" folders being available,

tests/acceptance/bind-data-test-attributes-in-components-test.js

Lines changed: 0 additions & 66 deletions
This file was deleted.

tests/dummy/app/templates/bind-test.hbs

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)