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

Remove deprecated automatic attribute binding #764

Merged
merged 1 commit into from
Jul 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ Features
- Removes properties starting with `data-test-` from your JS objects like
component classes for production builds

- Automatically binds properties starting with `data-test-` on all components
for development/testing builds

More information on why that is useful are available on our
[blog](http://simplabs.com/blog/2016/03/04/ember-test-selectors.html)!

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


### Usage with Curly Components

If you still use the old curly invocation syntax for components you can pass
`data-test-*` arguments to the components and they will automatically be bound
on the wrapper element too:

```handlebars
{{spinner color="blue" data-test-spinner=true}}
```

Please note that the automatic argument binding only works for components based
on `@ember/component`, but not `@glimmer/component`.


### Usage in Ember addons

If you want to use ember-test-selectors in an addon make sure that it appears
Expand Down
79 changes: 0 additions & 79 deletions addon/utils/bind-data-test-attributes.js

This file was deleted.

16 changes: 4 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ module.exports = {
this._stripTestSelectors = !app.tests;
}

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

_setupPreprocessorRegistry(registry) {
Expand Down Expand Up @@ -70,10 +73,6 @@ module.exports = {

this._registeredWithBabel = true;
}

if (this._shouldPatchClassicComponent) {
host.import('vendor/ember-test-selectors/patch-component.js');
}
},

cacheKeyForTree(treeType) {
Expand All @@ -85,13 +84,6 @@ module.exports = {
}
},

treeForAddon() {
// remove our "addon" folder from the build if we're stripping test selectors
if (this._shouldPatchClassicComponent) {
return this._super.treeForAddon.apply(this, arguments);
}
},

preprocessTree(type, tree) {
// remove the unit tests if we're testing ourself and are in strip mode.
// we do this because these tests depend on the "addon" and "app" folders being available,
Expand Down
66 changes: 0 additions & 66 deletions tests/acceptance/bind-data-test-attributes-in-components-test.js

This file was deleted.

21 changes: 0 additions & 21 deletions tests/dummy/app/templates/bind-test.hbs

This file was deleted.

Loading