Wednesday, 10 July 2013

ProofreadPage Extension: The Immediate Goals and Reports

The extension I am refactoring: ProofreadPage- MediaWiki extension

Tl;Dr: Separated data fetching from manipulation and presentation, separated the setting up of editing system for Page pages and began the refactoring of Page pages.

The coding period was supposed to begin from June 17th, but once I got familiar with the codebase, the wait did not seem worthwhile.

The aim of the ongoing refactoring is to make the code more modular and bug free.
I could see why the extension needed refactoring. Oh, before I forget, I would like to thanks Thibaut, one of my mentors, Abhay( Capt. Nemo ) and, Shashank( Kumar, Microsoft ) for the initial help on how to get started with refactoring. ) There was one BIG class which had loads of functions. There were functions which were unnecessarily huge. So, I did what anyone would have done to be safe. I separated the DB queries to a separate class. Things worked fine, to my relief. It did include a little regression which was pointed out by Thibaut. This reminds me that I need to go for regression testing as well.

The aim of the ProofreadPage class should be to just 'proofread' and not worry about getting data or setting up of the editing system. Separation of editing system had already taken place for Index pages.
I did it to some extent for the Page pages. Today itself, I pushed the remaining part of editing system for Page pages.

The immediate goal is to have the code for Page pages cleaned up. This is for two main reasons:
1. A lot of bugs are caused in the extension because not everyone allows JavaScript to be executed in their browsers. Moving a few functions to PHP would solve a lot of these bugs.
2. The ProofreadPage extension needs to be integrated with VisualEditor. ( Create an account on Mediawiki and try editing an article to see VisualEdtior in action ). The integration can't be done until Page page has a nice editing system based in PHP itself.

I thought it would be nice to blog about what I was working on. In case someone would like to be updated more regularly about the extension please watch this page.

No comments:

Post a Comment