Skip to content

Js refactor #745

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

Merged
merged 2 commits into from
Feb 6, 2015
Merged

Js refactor #745

merged 2 commits into from
Feb 6, 2015

Conversation

Johann-S
Copy link
Member

@Johann-S Johann-S commented Feb 4, 2015

Hello,

I created a common.js file to refactor some commons function.
We have talked about it with @XhmikosR in #491.

I added getBrowserCapabilities to window object, but i think it would be better if Ratchet had a namespace for example: rtc

And with that we will be able to do that:

window.rtc.getBrowserCapabilities = getBrowserCapabilities;

or

window.rtc.push = PUSH;

@@ -0,0 +1,27 @@
/* ========================================================================
* Ratchet: modals.js v2.0.2
Copy link
Member

Choose a reason for hiding this comment

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

This is false info.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes thank you i have fixed it

@XhmikosR
Copy link
Member

XhmikosR commented Feb 4, 2015

I agree about using a different namespace as long as the rest of the guys agree too.

PS. Don't forget to squash the patches.

@XhmikosR
Copy link
Member

XhmikosR commented Feb 4, 2015

Oh, and do grunt separately.

@XhmikosR XhmikosR added the js label Feb 4, 2015
@XhmikosR XhmikosR added this to the 2.1.0 milestone Feb 4, 2015
@Johann-S
Copy link
Member Author

Johann-S commented Feb 4, 2015

Ok I'll wait for any feedbacks on that to create a namespace for Ratchet.
And yes I'll squash my last commits.

What do you mean by running grunt separately ?
If I run grunt I'll create new files on the dist directory and it's wrote in the contributor guide we don't have to commit file in dist directory.

@XhmikosR
Copy link
Member

XhmikosR commented Feb 4, 2015

OK, I guess I'll try to remember to run it manually, no big deal.

@Johann-S
Copy link
Member Author

Johann-S commented Feb 5, 2015

I have squashed my commits, when this PR will be merged I'll work on fix push.js with getBrowserCapabilities

@XhmikosR
Copy link
Member

XhmikosR commented Feb 5, 2015

How about the namespace change? Can you add it in a separate patch first?

@Johann-S
Copy link
Member Author

Johann-S commented Feb 5, 2015

Yes sure I'll create another PR, to create a custom namespace for Ratchet

@XhmikosR
Copy link
Member

XhmikosR commented Feb 5, 2015

I was thinking to have it in this PR and see how it'll look like.

@Johann-S
Copy link
Member Author

Johann-S commented Feb 5, 2015

Oh ok sure, I was not sure if I'll add this on this PR or not, but ok I'll add the custom namespace on this PR.

@XhmikosR
Copy link
Member

XhmikosR commented Feb 5, 2015

/CC @connor @connors and @hnrch02

@@ -502,6 +502,6 @@
}
});
window.addEventListener('popstate', popstate);
window.PUSH = PUSH;
window.rtc.push = PUSH;
Copy link
Contributor

Choose a reason for hiding this comment

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

This would break backward compatibility. I'd leave it available under the global and also add it to the namespace.

@hnrch02
Copy link
Contributor

hnrch02 commented Feb 5, 2015

Otherwise looks good to me.

@Johann-S
Copy link
Member Author

Johann-S commented Feb 5, 2015

Thank you for your feedbacks.

And yes I'll add PUSH in the global scope and in Ratchet namespace to keep compatibility.
I'll just wait for other feedbacks to fix the name of the namespace to be sure all of you will like it.

@XhmikosR
Copy link
Member

XhmikosR commented Feb 5, 2015

Not sure which one is better, RACHET or Rachet... maybe the former.

Thanks @hnrch02 for the feedback :)

@Johann-S
Copy link
Member Author

Johann-S commented Feb 5, 2015

As you want, but RATCHET respects your coding style like PUSH so why not.

@@ -503,5 +503,6 @@
});
window.addEventListener('popstate', popstate);
window.PUSH = PUSH;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a comment here to remove this in the next major version?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes it's better to keep that in mind.

XhmikosR added a commit that referenced this pull request Feb 6, 2015
@XhmikosR XhmikosR merged commit ec4b381 into twbs:master Feb 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants