Skip to content

Replacing jQuery with native methods#59

Merged
Kerrick merged 5 commits intosecondstreet:masterfrom
sivakumar-kailasam:remove-jquery-dependency
Mar 9, 2018
Merged

Replacing jQuery with native methods#59
Kerrick merged 5 commits intosecondstreet:masterfrom
sivakumar-kailasam:remove-jquery-dependency

Conversation

@sivakumar-kailasam
Copy link
Copy Markdown

Many apps decide to exclude jQuery and it makes it impossible if addons use them. Its good that material components themselves don't care about jQuery. This is PR removes all dependency on jQuery.

Converted using ember-native-dom-helpers-codemod
@sivakumar-kailasam
Copy link
Copy Markdown
Author

I've raised a PR to chrislopresto/ember-freestyle#157 that removes freestyle's internal dependency on jQuery. Once it lands, it'd be safe to update to that version while this PR uses the branch of that PR.

@sivakumar-kailasam
Copy link
Copy Markdown
Author

@Kerrick the previous failure was because of a lack of changes on .travis.yml. Its fixed now.

@Kerrick
Copy link
Copy Markdown
Contributor

Kerrick commented Feb 15, 2018

Thanks for the PR! Definitely in favor of this strategy. Once code review has passed we can merge & ship this 🎉

Copy link
Copy Markdown

@danielraggs danielraggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left you one question, but otherwise everything looks good.

getFocusableElements: () => this.$(FOCUSABLE_ELEMENTS),
hasNecessaryDom: () => !!get(this, 'element') && !!this.$(ITEMS_SELECTOR).length,
getFocusableElements: () => this.element.querySelectorAll(FOCUSABLE_ELEMENTS),
hasNecessaryDom: () => Boolean(this.element),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, I might be missing something here but what happened to the ITEMS_SELECTOR?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the check in their default adapter, so went with it. Also we're guaranteed that the necessary dom exists if the element gets rendered in this case.

Copy link
Copy Markdown

@danielraggs danielraggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Kerrick
Copy link
Copy Markdown
Contributor

Kerrick commented Feb 16, 2018

Looks like the only thing left is for chrislopresto/ember-freestyle#157 to get merged & published so this PR's branch can point to a published version of ember-freestyle.

@sivakumar-kailasam
Copy link
Copy Markdown
Author

@Kerrick this is good to merge now.

@danielraggs
Copy link
Copy Markdown

@sivakumar-kailasam Your PR is almost good to go; however, I did some quick testing and found that the MDC-menu component has a bug in your branch: once the menu is opened, you're not able to click outside to close the menu. After you fix this bug your PR will be good to merge! 👍

@sivakumar-kailasam
Copy link
Copy Markdown
Author

@danielraggs Sure will take a look at that and see if I can add a test case for it while take a stab at it 😄

@sivakumar-kailasam
Copy link
Copy Markdown
Author

@danielraggs added a fix but couldn't add a test for it yet. I hope to add acceptance tests when I raise a different PR to update the deps.

@Kerrick Kerrick mentioned this pull request Mar 9, 2018
Copy link
Copy Markdown
Contributor

@Kerrick Kerrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug fix looks good

@Kerrick Kerrick merged commit 44f5c7d into secondstreet:master Mar 9, 2018
Kerrick pushed a commit that referenced this pull request Mar 16, 2018
- ➕ Add prettier.js (#67)
- ➕ Add prettier.js (#62)
- ➖ Replace jQuery with native methods (#59)
- ✨ Bind DOM events to some components (#61)
- 🐛 Don't set foundations on destroyed components (#60)
- 🚑 Fix CI autodeploy
- :busts_in_sillhouette: Add Contributor
- 🚀 AutoDeploy docs to GitHub Pages on merge to master (#58)
- 💚 Temporary Travis CI workaround
- 👥 Add contributor
- ⬆️ [docs] Upgrade Ember Composable Helpers
- 🐛 Fix #52
- 📝 Fix contributors (#53)
- ⬆️ Upgrade Ember CLI to 2.18.0
- 🐛 If no label is present show the placeholder
- 🐛 Move ember-freestyle to devDependencies
- ✨ Implement {{mdc-drawer}}  (#45)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants