jQuery Conference (July 24- July 25)
Use it to Automate the Tasks as much as possible.
example: 1) JsHint
2) Minification process
3) Execute the test cases
Comparison with Gulp:
Gulp can also a good task runner. However, Its not necessary to migrate Gulp.
Test driving jQuery Plugin Development
Techstack used: Karma, jQuery, jasmine
example: 1) created the plugin of the jquery. example link (https://github.com/nashjain/jQComment/commits?author=nashjain)
Techstack used: React JS
example: Created a booklist component using reactjs
KeyNotes Observed: 1) Its one way data binding
2) It comes up with component funda (unconventional idea). child data is immutable and always data flows from parent to child. However there are hacks to flow data from child to parent
3) Think of reactjs component as view always getting refreshed with latest data (for any data change). Think of it as a clean slate being update each time again and again
5) It uses Virtual Dom and creates the diff between what is changed and updates the component. (Diff algorithm is the awesome feature of the react js)
6) React JS is a small library provides view updation. However for entire architecture using Flux.
Mistakes to be avoided (especially plugin authors), while using jQuery
- Don’t use Ajax.setup(), As it makes changes of all the ajax calls. Use a command function which does ajax call with custom parameters (instead of using $.Ajax straight away)
- Use $.text() method to add data into DOM. (For security, to prevent XSS)
- Don’t overrelay on jquery for small changes.
- Event name spaces are the best practice, However to aviod the namespace collision. use the _.random method with a random number as the event name. (Make sure event namespace is unique)
- Use chrome dev tools to identify the problem.
- In jquery 3.0 will have the latest implementation in adherece to promise spec.
- Don’t overrely on jquery migration plugin. Fix the errors thrown by the plugin and move on
- Some methods like $.get, $.post,$.load are not good ones to use. But they are not removed since many people use it and they helped in jquery evolution.
Key Take aways from the conference:
1)As a team, we have to write same style of code. This is what jquery team follows. An example of this is
Spaces Vs Tabs → Tabs
Commas at the starting → no
Only one Var → no
Single Quotes vs Double quotes → Double quotes
Semicolon → yes
2) Code review has to be strict.
Automate as much as the code review process initially. (example as using jsHint)
Review the logic as strictly as possible.
3) It’s not necessary to integrate the latest libraries, without evaluation
Its not necessary for us to use React JS, Do a POC on it. identify the pros and cons
4)Spend time on educating the developers
To have a common style of development, Invest time on educating the developers
5) TypeScript, @Coffeescript usage
Use Document.js, Docco. jsDoc3 is also fine. However some speakers were against documentation, they believe method names should convey the meaning.
7) Shadow Dom
Shadow Dom sucks! . Some how all the speakers disagreed with shadow dom. Don’t use polymer in the project, Its going to die
Metor.js is one good library provides this capability, However its tied with Mongo database. We can evaluate on ShareJS
9) Good Libraries and tools for CSS
stylus, JSS, CSSSCSS, DSS, CSSdoc, JSCSS, CSSlint, interm, bem
10) looks like EmberJS is awesome compared to Angular JS
11) Don’t spend too much time on Offline support of the webapp. Since the Internet is growing, definitely not a good idea on spending so much time on offline support of webapp.