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

AMD/CommonJS/Globals #12909 #13772

Merged
merged 1 commit into from
Jun 11, 2014
Merged

AMD/CommonJS/Globals #12909 #13772

merged 1 commit into from
Jun 11, 2014

Conversation

fat
Copy link
Member

@fat fat commented Jun 10, 2014

the following jshint tests are failing:

  • Missing "use strict" statement.
  • 'define' is not defined.
  • 'require' is not defined.

I dont want to add "use strict" to this factory method. If that means removing the js hint rule for that, im fine with that.

Not sure where to add our define/require exports… @cvrebert any idea?

@XhmikosR
Copy link
Member

You can just disable the warning for that code block...

@fat
Copy link
Member Author

fat commented Jun 10, 2014

i dont think we need the strict rule because we follow a template with all our plugins. the top of them is copy pasted and completely consistent across the board.

i also had to disable requireCamelCaseOrUpperCaseIdentifiers because o_o is an adorable function name and much better than "factory".

i went back and forth with disallowSpacesInsideParentheses… because ( o_o) looks better to me than (o_o) … but i do think that rule is kinda nice to catch accidental spaces in other parentheses

@fat
Copy link
Member Author

fat commented Jun 10, 2014

could be convinced of the validity of disallowSpacesInsideParentheses

@fat
Copy link
Member Author

fat commented Jun 10, 2014

but also kinda meh about it

@XhmikosR
Copy link
Member

So you basically want to revert every change everyone else made... Oh well, I guess I'll stop bothering with the JS part anymore. No worries.

@mdo
Copy link
Member

mdo commented Jun 10, 2014

@XhmikosR I don't think @fat's changes are that far removed from what we have today. They certainly aren't reverting everyone else's changes, are they?

@hnrch02
Copy link
Collaborator

hnrch02 commented Jun 10, 2014

I don't think we should remove any rules that ensure consistency across the JavaScript because of an adorable function name. I mean it is cute, but IMHO not worth it.
But 👍 on the actual UMD stuff.

@cvrebert
Copy link
Collaborator

Yeah, let's avoid the gratuitously opaque/weird function name.

@cvrebert
Copy link
Collaborator

Not sure where to add our define/require exports… @cvrebert any idea?

I haven't used AMD/CommonJS before, so I have no idea.

@XhmikosR
Copy link
Member

@mdo: it is reverting the changes I made in the other PR, which had like 3/4 reverted already. No worries, I don't mind, I'll leave others bother with JS.

@@ -7,7 +7,11 @@
* ======================================================================== */


+function ($) {
(function ( o_o) {
Copy link

Choose a reason for hiding this comment

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

:)

Copy link

Choose a reason for hiding this comment

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

:)

Copy link
Collaborator

Choose a reason for hiding this comment

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

ಠ_ಠ

@fat
Copy link
Member Author

fat commented Jun 11, 2014

just turning off strict mode and requireCamelCaseOrUpperCaseIdentifiers which aren't hard to miss things. We obviously always camel case our identifiers (except in this case, but it's very intentional) and strict mode isn't something i'm worried about us missing in a plugin.

fat added a commit that referenced this pull request Jun 11, 2014
@fat fat merged commit 8d8524e into master Jun 11, 2014
@fat fat deleted the fat-amd branch June 11, 2014 00:24
@hnrch02
Copy link
Collaborator

hnrch02 commented Jun 11, 2014

You could have just added

/* jshint strict: false */

to the body of the factory function.

@hnrch02
Copy link
Collaborator

hnrch02 commented Jun 11, 2014

[...] which aren't hard to miss things.

That's true for us, but having undocumented/unenforced rules about our coding style makes contributing harder. If somebody were to submit a PR and use an identifier that's not in camelCase, the style check that should report such problems passes and the error can't be resolved until somebody from the team points this out to the contributor. Not that fatal, as PRs are properly reviewed by us before they're merged, but given that the tool we use for code style checking has this feature, I think it's counter-intuitive not to use it. Even more so, as we're removing this because of an "gratuitously opaque/weird" function name.

Anyways, just my 2¢.

@mdo mdo added this to the v3.2.0 milestone Jun 11, 2014
@mdo mdo mentioned this pull request Jun 11, 2014
@hnrch02
Copy link
Collaborator

hnrch02 commented Jun 12, 2014

This also introduced regression of #10038.

@cvrebert
Copy link
Collaborator

@hnrch02 File new issue please.

@hnrch02
Copy link
Collaborator

hnrch02 commented Jun 12, 2014

@cvrebert I'm preparing a PR right now.

hnrch02 added a commit to hnrch02/bootstrap that referenced this pull request Jun 12, 2014
fat added a commit that referenced this pull request Jun 12, 2014
cvrebert added a commit that referenced this pull request Jun 23, 2014
Will hopefully revert this reversion and land a fully-working version of UMD in v3.3.0.

Revert "some changes from #13801 - add strict mode back and =="
This reverts commit 2b302f6.

Revert "Fix regression of #10038 introduced by #13772"
This reverts commit e9d6756.

Revert "MD/CommonJS/Globals #12909"
This reverts commit 1c6fa90.

Revert "address #13811"
This reverts commit f347d7d.

Conflicts:
    js/carousel.js
    js/collapse.js
    js/dropdown.js
    js/modal.js
    js/tab.js
    js/tooltip.js
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.

8 participants