JS Test for Joomla 4 Supun Wanniarachchi

Sunsets are beautiful to the point that they seem as though we were looking through the doors of Heaven. Sunsets are just little glimpses but the beauty of the sunset is a farewell kiss for the day. So this GSoC journey is a sunset of my life. It enlightens my career and is a really good life changing experience. I learn from the past, dream about the future and don’t forget to enjoy life. Don’t forget beautiful sunsets need cloudy skies.

Joomla! illuminated this journey and gave its really good value. The Google Summer of Code 2017 journey came to an end. But every end is a new beginning. This post will give you insight on JavaScript Tests for Joomla! 4 and what really happened during the GSoC period and the project outcome.

Time flies so fast and Google Summer of Code 2017 journey came to an end on 29th August.

JS Test for Joomla

I worked with JavaScript Tests for Joomla! 4 Project during GSoC period. It’s not only adding JavaScript tests for Joomla! with respect to JavaScript, we are trying to be lighter and faster.  With that we need to give some insight why it was decided to replace jQuery. We all know jQuery is JavaScript and jQuery can be supplanted with Vanilla JavaScript and CSS3. In this project, I made the Vanilla JavaScript conversion for several jQuery libraries. The new Media Manager in Joomla! 4 is using vue.js components and through this project we added new test configurations for vue.js components and tested it. Above all works tested and implementation completed, we sent some PRs for review. I explained the importance and the project details in my previous article. You can find it here.

Adding new tests coverage is, for Joomla! 4, a really essential task. We improved existing tests suite for Joomla! 4 and also added new JavaScript Unit tests. So the idea is to add more tests and do the testing for Unit tests libraries.

Google Summer of Code is not only about coding and sending as a final output. It also helps to develop your soft skills, documentation skills, and so much more. If you are lucky enough to work with Joomla, you can definitely get the best out of it. Mentors give clear guidance and help to solve any impediments that students come across. I learn a lot of theories, JavaScript ES6 and also they helped me to approach good coding practice. Mentors reviewed all the PRs we sent, added their comments and discussed if there was anything special. This experience is really worth for my career.

Every little thing of this GSoC journey is really interesting and exciting.

JS Test for Joomla

No probably not. There’s a cold ‘war’ in Joomla! 4 between jQuery and VanillaJS 😉. In Joomla! 3.X versions we used jQuery everywhere and at that stage it was a good advantage for us.

But what if I said,

Vanilla JavaScript performed 9x faster than jQuery ? Could you believe this 😮

Earlier IE6 and older browsers didn’t support most of the Javascript functions and that’s the reason why we moved to jQuery. But now, IE11 and latest versions support Javascript so it’s right time to move forward. There’s no reason to limit yourself within JavaScript libraries. So now the battle is come to the very crucial stage. More than 90% of jQuery complex libraries are fully converted to Vanilla JavaScript. The target is to have Joomla! 4 free of jQuery 😉. Do not hesitate to visit the GitHub repository of this project.

Javascript and Joomla

All the PRs are ready for VanillaJS conversion as well as new Unit tests for existing test suite. We have to move jQuery part in Unit tests to Vanilla JavaScript and then no more jQuery in Joomla 4. These PRs need to be merged as soon as possible and convert Unit tests using Javascript. It’s a real pleasure to see Joomla! 4 without jQuery in the near future and having complete testsuite for JavaScript libraries 😉.

I would like to thank Joomla! community and especially my mentors:  Ruchiranga Wickramasinghe, Ashan Fernando, Yves Hoppe and Dimitris Grammatikogiannis for all their great support during GSoC period. The knowledge and wisdom they have imparted upon me have been a great help and support throughout my career. I believe my success is at least in part due to their sincere support and mentorship.