-
Notifications
You must be signed in to change notification settings - Fork 0
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
Initial reviewable code #1
Conversation
.travis.yml
Outdated
- npm install bower | ||
- 'export PATH=$PWD/node_modules/.bin:$PATH' | ||
- bower install | ||
node_js: 6 |
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'd use 8 to be more up to dane.
README.md
Outdated
|
||
> Handles palindrom-client disconnection events and creates the needed UI to give the user control over them | ||
|
||
Custom Element that binds with [palindrom-client](https://github.com/Palindrom/palindrom-client) connection events and shows a simple UX that allows the user to interact with them. It is can be used as an example of designing your own error catcher. |
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.
"shows UI", I think experience is not the thing to show, is a thing to feel.
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.
Right.
README.md
Outdated
|
||
Custom Element that binds with [palindrom-client](https://github.com/Palindrom/palindrom-client) connection events and shows a simple UX that allows the user to interact with them. It is can be used as an example of designing your own error catcher. | ||
|
||
Please check the code at `palindrom-error-catcher.html` file to see how events are handles. |
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.
"handled"
wct.conf.json
Outdated
"sauce": { | ||
"disabled": false, | ||
"browsers": [{ | ||
"browserName": "firefox", |
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 think we should test in Edge as well. Plus we should be able to test firefox in "local"
palindrom-error-catcher.html
Outdated
this.cancelReloadingBtn = shadowRoot.querySelector('.cancel-reloading-btn'); | ||
this.reloadNowBtn = shadowRoot.querySelector('.reload-btn'); | ||
|
||
this.targetSelector = this.getAttribute('target-selector') || 'palindrom-client'; |
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.
You should not read attributes in the constructor
palindrom-error-catcher.html
Outdated
this._bindCallbacks(); | ||
} | ||
_bindToElement() { | ||
this.target = this.getRootNode().querySelector(this.targetSelector); |
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'dcheck in the document
if there is none in the current root, as this element may be used in SD composition, there is no palindorm-client
palindrom-error-catcher.html
Outdated
_bindToElement() { | ||
this.target = this.getRootNode().querySelector(this.targetSelector); | ||
} | ||
_bindCallbacks() { |
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'd move it out of public API
Daaaamn! I had no idea |
Could you add CONTRIBUTING.md, LICENSE, issue_template and make README.md more elaborate as in https://github.com/Juicy/juicy-element-boilerplate (usage, attributes, etc.) |
palindrom-error-catcher.html
Outdated
this.genericErrorPane.addEventListener('click', reload); | ||
this.subscribed = true; | ||
} | ||
_unsubscribeToEvents() { |
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 think those three _methods
could also be hidden for public, to make sure nobody will start using them so we will be forced to support it ;)
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.
But this is extremely anti-pattern. They're part of the element class and I feel leaving them outside and passing parameters to them is like making static functions in a class and using them in another class once. This misses the point of the class altogether. I think the underscore should suffice to say that they're not part of the API. I mean I understand doing this for utility helper functions, but these functions are like life-cycle methods for the instance, doesn't feel right to keep them outside.
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 wouldn't say it's "extremely anti-pattern" it's opinionated, what is worse expose private methods as effectively public or define private methods outside of class
keyword. There are just ways to address the problem, see more solutions at http://exploringjs.com/es6/ch_classes.html#sec_private-data-for-classes
You can see discussions like this in many places, like:
airbnb/javascript#1024
Personally, I think putting variably/function outside of published scope is and was the way to make them local/private in JavaScript since the very beginning, I don't like pretending JavaScript and its classes are like Java. Usually, I try to avoid quasi-/convention-based- private members as much as I can, unless I really need them for inheritance or smth. As I never trus convention to be reliable security guard.
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.
Anyway, as I said to me it's just an opinion if you have the different one, go ahead, that was just my comment and suggestion. Failing FF, and lack of contributing are more blocking problems :)
…m/palindrom-error-catcher into initial-reviewable-code
5e93b39
to
8af681e
Compare
Should be ready |
fa07c85
to
a51a4c7
Compare
- Add contributing.md - Add Gruntfile for auto version bumping - Extend Readme.md - Add issue template
a51a4c7
to
5602c7d
Compare
Is it desired to change the behavior so it always reloads the page after few secs in case of the server crash? if so, then LGTM |
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.
Checked the code and tested with Kitchensink
Maybe I'm wrong, but isn't this what we do now? |
You're right. Then it's 100% fine to me. |
Related to Palindrom/palindrom-client#71 and Palindrom/palindrom-client#69