Confirmed users
6
edits
WikiSupport (talk | contribs) (ver) |
|||
| Line 31: | Line 31: | ||
''' NOTE: ''' I will be having my final exams at college for which I will have to prepare full time, so I have taken permission from my mentor to take a preparatory break till 5th June 2014. After that all the pending work will be taken care off. All the remaining testing work will be done and after that only further migrations will be performed. | ''' NOTE: ''' I will be having my final exams at college for which I will have to prepare full time, so I have taken permission from my mentor to take a preparatory break till 5th June 2014. After that all the pending work will be taken care off. All the remaining testing work will be done and after that only further migrations will be performed. | ||
<hr> | |||
''' Week 4 , 6th June-15th June 2014 ''' | |||
So finally my exams got over and I started with my work ! | |||
The work done during this phase is as follows: | |||
*The changes made to the file [http://bit.ly/1m2WLCI TUI.js] were tried to be tested. While testing it we found out that the YUI3 modules were not getting loaded. The reason behind this was that the [http://bit.ly/1qU9pce previous changes] made to the header.html.tmpl file for creating a YUI3 loader were incomplete.When we include a module using the use() function of the YUI() constructor the module doesn’t work unless the the JS file in which its class is defined is loaded already. So what we were missing was the part which would pre-fetch the YUI3 JS files so required for the modules to work. We came up with these , [https://github.com/ishitvagoel/bugzilla/commit/ea3fc5734811f9bd607c6e28d1323d583ddd0726 Loader Fix], changes which made it possible for the script elements to be be created which pre-fetch the required JS files , while rendering the HTML. | |||
*Still this was not enough ! We again tried to test the TUI.js file on the page enter_bug.cgi page of Bugzilla and found out that even when all the required JS files were getting pre-fetched and the modules were expected to get loaded without any problem , as soon as we entered the enter_bug.cgi page we came across an error ” TypeError: Y.on is not a function”. This was completely unexpected ! We tried to fix the issue and spent a lot of time on this problem and finally headed towards #yui for some guidance.There :foxxtrot helped us identify what the problem was due to. The problem was due to the fact that we had not included all the dependencies for the modules we intended to use, because of which when the use() function tried to load the modules the asynchronous behaviour of the YUI loader was triggered such that unless the required dependencies would be loaded the rest of the code could proceed to be executed. This created a problem for us as Y.on() function was getting used even before the dependencies for the module(yui-base) it is defined in were loaded and hence the aforementioned error came up. So :foxxtrot suggested us to use a config object {bootstrap:false} for the YUI() constructor. We included this config object , and then using the [http://yuilibrary.com/yui/configurator/ YUI3 Configurator] , calculated all the dependencies and included all the dependency modules along with the modules we wanted to use on the bug/create/create.html.tmpl file, through the yui3 array, and then tested the TUI.js file on enter_bug.cgi page again. This time Eureka ! it worked :) Although this method works , it has some shortcomings too, that the number of dependency modules to be loaded is way too large which makes the loader slow as the script element for each of the module has to be generated and also that we ourselves will have to calculate the dependencies. What we need to do is to automate the offline dependency calculation or maybe combine the modules into one module using a [https://github.com/tivac/yui-seeder File combiner].So as :dobedobedoh (#yui) suggested , we tried to implement in our header.html.tmpl the [http://yuilibrary.com/yui/docs/api/classes/Loader.html YUI3 Loader], the gist of which can be seen here, [https://gist.github.com/ishitvagoel/8372ceceeae38e4d2766#file-header-html-tmpl-L204 YUI3 Loader Experiment] .The experimentation on the Loader is still going on, but as of now to proceed with the migrations and testing we have decided to use the present working version of the Loader. | |||
*Facing all these challenges we somehow managed to progress ! We tested the TUI.js and the attachment.js files and the changes made to them worked fine. Then the migration of the files change-columns.js , comments.js, flag.js, util.js and global.js and the Voting Extension was done. The changes to these files will be pushed to the [https://github.com/ishitvagoel/bugzilla GitFork] as soon as they are tested. Currently we are trying to migrate the bug.js and custom-search.js files. | |||
So far so good ! | |||
<hr> | |||
{{VerifiedUser}} | {{VerifiedUser}} | ||