-
Notifications
You must be signed in to change notification settings - Fork 90
Remove JQuery dependency from default modules #337
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
Conversation
2b45a01 to
1c1c4a6
Compare
1c1c4a6 to
4512cc4
Compare
| 'use strict'; | ||
|
|
||
| return { | ||
| restrict: 'A', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why just an 'A'? I expected <pf-bootstrap-select..., not having to have to use a <div pf-bootstrap-select=...
Not a big issue though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically the Angular Patternfly directives are Attribute only.
| * @param {boolean} updateActiveItemsOnClick Flag if active items should be marked on click rather than on navigation change, default: false | ||
| * @param {boolean} ignoreMobile Flag if mobile state should be ignored (use only if absolutely necessary) default: false | ||
| * | ||
| * @example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are all these changes to vert. nav? Doesn't seem to have anything to do with removing jQuery or pf-select?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example was using JQuery to initialize the vertical navigation. Things like:
$(document).ready(function()
I'm trying to use as little jQuery as possible throughout even in the examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for the info.
| <div class="col-sm-10"> | ||
| <select pf-select ng-model="type" id="type" ng-options="o as o for o in types"></select> | ||
| <div class="col-sm-4"> | ||
| <div pf-bootstrap-select current-selection="type" id="type" selections="types"></divselect> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that correct closing tag? </divselect>?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. I will fix that. Thanks.
|
This is great work Jeff! I realize this was the result of a breakaway sprint story whose end goal was to remove jQuery dependency, so this PR contains all those changes to accomplish that goal. However, this PR changes several components. Ideally, this PR would have been better as several smaller PRs. I'm going to clone this dev branch and do some manual testing, but so far everything looks good.
|
|
Thanks @dtaylor113. Agreed which is why I did not squash commits so that the progression was evident and each commit is reviewable on its own. |
|
Think we need to udpate the README file with some of the stuff you talk about in this PR's Description:
|
|
Hi @jeff-phillips-18, ran through all ngdoc examples. I'm seeing two issues: In ngdocs:view
Everything else looks good 👍 |
|
Fixed the 3 issues noted by @dtaylor113 |
| 'patternfly.jquery' | ||
| ]); | ||
|
|
||
| Note: the pfSelect and datepicker directives are only available in the patternfly.jquery module. Using these directives requires the inclusion of the jQuery library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should 'datepicker' be 'pfDatepicker' or are you also including the straight bootstrap-datepicker as requiring jQuery?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know base refs README talks about Wiredep. I just played around with angular-patternfly-demo-app which uses something like wiredep (grunt-usemin?) and it was always including patternfly.js. Since we talk about just using patternfly-settings.js here, should we mention how to config wiredep to grab the correct file, or is that up to the app dev to know/figure out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to leave that exercise to the reader. You can setup wiredep to include/exclude how you like.
|
I haven't changed the name and would prefer not to to keep as much backwards compatibility as possible. |
|
LGTM 👍 |
5fa2925 to
4ccbb17
Compare
| 'patternfly.charts' | ||
| ]); | ||
| 'patternfly.charts', | ||
| 'patternfly.jquery' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We seem to have lost the granularity of our modules. Should we consider keeping the granularity, but adding a -jquery suffix to the modules to indicate they bring in the jQuery dependency (with possibly a common jquery parent dependency)? eg. patternfly-datepicker-jquery or patternfly-form-jquery.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 2 jquery dependent directives. We could add modules for each patternfly.datepicker and patternfly.select then have patternfly.jquery pull both in. I wouldn't be a fan of patternfly-form-jquery with only one directive then patternfly.jquery pull in patternfly-form-jquery. that's 3 modules for one directive.
|
I've reviewed each of the commits - thanks for not squashing them @jeff-phillips-18, it's much easier to review each change in context. The changes overall seem reasonable to me, I'll leave it up to those more familiar with the angular-patternfly implementation to assess there technical validity (thanks @dtaylor113). I had one question I asked inline about the module consolidation into the The only other question I have is to confirm that this PR does not introduce a breaking change for downstream applications. Rather they will have to "opt in" to get the jQuery independence provided by this PR. Nice work overall @jeff-phillips-18, a very well thought out and comprehensive approach! |
|
Well, this is the opposite @bleathem. Any downstream applications currently using pfSelect or pfDatepicker will need to "opt in" in order to continue using them (by adding a dependency on the patternfly.jquery module). To "opt out" of jquery dependence would require a patternfly module that was jquery independent. I couldn't think of a good naming convention for that. Any thoughts or is release noting this good enough? |
|
@bleathem ^^ |
4ccbb17 to
47ccc07
Compare
Using the hyphenated version of the require specifications does not work in a non-jquery environment.
47ccc07 to
cdc22d7
Compare


Description
This PR removes the JQuery dependency from the default patternfly module. Two of the existing directives have been moved from the default module to patternfly.jquery: pfSelect and pfDatepicker. To use either of these directives add the patternfly.jquery module to your application module.
An additional directive, pfBootstrapSelect, has been added to achieve the same basic features of pfSelect but without the JQuery dependency.
The angular patternfly code has been adjusted to use the non-JQuery patternfly settings. To keep JQuery independence, include only patternfly-settings.js rather than patternfly.js.
@dtaylor113 @dgutride @dlabrecq @bleathem