-
Notifications
You must be signed in to change notification settings - Fork 90
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
Use native-dom-helpers internally #311
Comments
Thanks @knownasilya for opening this issue. |
Well, just say the words on how you like to proceed. I'm sure there are people that like to contribute. |
Would also love to see this. Currently using One thing to keep in mind: all But for this to work with |
You could still keep chainability, you'd just need to change the API to have an explicit method on the end to return the promise. But yes, it would be a breaking change. |
Since the beginning we made all All the following are supported right now const page = create({
visit: visitable('...'),
foo: clickable('...'),
bar: clickable('...'),
});
await page.visit();
await page.visit().foo();
await page.visit().foo().bar();
await page.visit().foo().then(() => ...);
... This is because of this ember-cli-page-object/addon/-private/dsl.js Lines 12 to 17 in 88fad42
and this
which is injected in all page objects nodes. |
One approach we want to take is to make jQuery a direct dependency of this addon and only include it in tests, allowing users not to include jQuery on their app bundle. Removing jQuery entirely from the addon will require a lot of effort and break existing features... but we'll do it eventually. We want to start this migration by replacing the events first by using native-dom-helpers addon. |
Oh, didn't know, that's brilliant!
Not so sure about this one. Initially also thought about this approach when getting rid of jQuery from ember-bootstrap, because refactoring all the tests seemed to be most of the work. But you end up testing your code in a environment that is substantially different than production, so if you still have some jQuery usage left over, this will still work in tests, but break in the real world. (So I ended up making https://github.com/simonihmig/ember-native-dom-helpers-codemod) This is true even more so for apps, where it is easy to get some (even nested) addon require jQuery without you necessarily knowing about it. So tests pass, but app is broken (without jQuery). Just wondering, but maybe there is a way to use it just internally and hide it from app code, so |
on the same boat
I've tried: $ npm i --save jquery // index.js
module.exports = {
name: 'ember-cli-page-object',
options: {
nodeAssets: {
// ...
jquery: {
import: ['dist/jquery.js'],
}
}
}, It makes |
@san650 just published v1.13.0-alpha.1 which includes Docs in progress #334 |
https://github.com/cibernox/ember-native-dom-helpers
Relates to #256 and #289
Leaving this as a placeholder.
cc @san650 @cibernox
The text was updated successfully, but these errors were encountered: