Moodle
  1. Moodle
  2. MDL-34915

Provide SimpleYUI access in Moodle

    Details

    • Testing Instructions:
      Hide

      Clear all caches, verify that Moodle UI that uses YUI still works:
      1/ navigation
      2/ groups UI
      3/ enrolments UI
      4/ quiz
      5/ mod chooser
      6/ etc.

      Try doing a 'stress test' using the course features demo and the course editing page. Examine if its better/worse than before.

      Show
      Clear all caches, verify that Moodle UI that uses YUI still works: 1/ navigation 2/ groups UI 3/ enrolments UI 4/ quiz 5/ mod chooser 6/ etc. Try doing a 'stress test' using the course features demo and the course editing page. Examine if its better/worse than before.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w43_MDL-34915_m24_simpleyui

      Description

      Since 3.2.0 there is a new way to initialise global "Y" instance - SimpleYUI, see http://www.yuiblog.com/blog/2010/09/03/coming-inyui-3-2-0-simpleyui

      Benefits:

      • 100% backwards compatible
      • easier to migrate oldstyle YUI2 code because Y is available in global scope everywhere
      • supposedly easier to understand for JQuery users
      • somehow seems to make moodle UI flicker less during page load
      • simplifies static JS in "M.*" scope and module.js files

      Potential problems:

      • performance - are pages are very heavy, it seems that loading more at the beginning makes page init feel faster, the total time measured seems to be the same
      • encourages different coding styles - it does not fit "YUI.add('moodle-xxx', function(Y) {" much

        Gliffy Diagrams

          Issue Links

            Activity

            Show
            Petr Skoda added a comment - Here is a sample patch: https://github.com/skodak/moodle/compare/b6582000f59...w33_MDL-34915_m24_simpleyui
            Hide
            Petr Skoda added a comment -

            I am personally not sure if SimpleYUI is good for Moodle, but it seems useful for beginners and maybe it could silence the most vocal opponents of YUI in Moodle...

            Show
            Petr Skoda added a comment - I am personally not sure if SimpleYUI is good for Moodle, but it seems useful for beginners and maybe it could silence the most vocal opponents of YUI in Moodle...
            Hide
            Petr Skoda added a comment -

            more information at http://www.goer.org/YUI/sample-loader-dom-effects.pdf, page 6 "1.2 Loading SimpleYUI"

            Show
            Petr Skoda added a comment - more information at http://www.goer.org/YUI/sample-loader-dom-effects.pdf , page 6 "1.2 Loading SimpleYUI"
            Hide
            Petr Skoda added a comment -

            We have discussed this again during the hackfest, resubmitting.

            We need some feedback from themers to confirm this really helps, this should be ideally used in themes only, standard plugins should have xxx/yui/module/module.js modules.

            Show
            Petr Skoda added a comment - We have discussed this again during the hackfest, resubmitting. We need some feedback from themers to confirm this really helps, this should be ideally used in themes only, standard plugins should have xxx/yui/module/module.js modules.
            Hide
            Amy Groshek added a comment -

            Hi Petr, I see your branch. Will test.

            Show
            Amy Groshek added a comment - Hi Petr, I see your branch. Will test.
            Hide
            Dan Poltawski added a comment -

            The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

            TIA and ciao

            Show
            Dan Poltawski added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
            Hide
            Amy Groshek added a comment -

            Hi Petr, I just tested. This works just as the YUI documentation says it should. I have access to YUI DOM manipulation through the Y object in the page. My guess is that this will resolve some of the basic issues for theme designers. At the very least, when folks are disgruntled about jQuery, we can offer this.

            Some JS I tested with in dev console:

            Y.one('#page').hide();
            Y.one('#page').show();
            Y.one('#page').append('Testing');
            Y.one('#page').append( 'wwwroot is ' + M.cfg.wwwroot );
            

            Show
            Amy Groshek added a comment - Hi Petr, I just tested. This works just as the YUI documentation says it should. I have access to YUI DOM manipulation through the Y object in the page. My guess is that this will resolve some of the basic issues for theme designers. At the very least, when folks are disgruntled about jQuery, we can offer this. Some JS I tested with in dev console: Y.one('#page').hide(); Y.one('#page').show(); Y.one('#page').append('Testing'); Y.one('#page').append( 'wwwroot is ' + M.cfg.wwwroot );
            Hide
            Petr Skoda added a comment -

            Thanks a lot Amy.

            Show
            Petr Skoda added a comment - Thanks a lot Amy.
            Hide
            Dan Poltawski added a comment -

            My +1 to this, as I think its really the main thing people miss from jquery, but needs more votes.

            Show
            Dan Poltawski added a comment - My +1 to this, as I think its really the main thing people miss from jquery, but needs more votes.
            Hide
            Martin Dougiamas added a comment -

            I tested it too just from a user point of view. It seems to work fine and yes, things seem to "snap" onto the screen better. Why is that?

            My +1 anyway.

            Show
            Martin Dougiamas added a comment - I tested it too just from a user point of view. It seems to work fine and yes, things seem to "snap" onto the screen better. Why is that? My +1 anyway.
            Hide
            Dan Poltawski added a comment -

            OK, i've integrated this now.

            We need to keep a close eye on the performance impact and also give gudielines on how the different approaches should be used. See also: MDLSITE-1774

            But actually, I think the 'jquery like' approach provides a number of advantages which could be useful in core too.

            Show
            Dan Poltawski added a comment - OK, i've integrated this now. We need to keep a close eye on the performance impact and also give gudielines on how the different approaches should be used. See also: MDLSITE-1774 But actually, I think the 'jquery like' approach provides a number of advantages which could be useful in core too.
            Hide
            Ankit Agarwal added a comment -

            Hi,
            I did a whole range of testing on ff, chrome, and IE with profiling in all. There was no regressions encountered.
            The performance change was inconclusive. Subjectively I couldn't tell any difference. Profiling led to varied results, with randomly some times int performing better and sometimes stable.
            Memory usage did seem a little better(less memory used) in integration, not sure if that is related.

            Passing after discussing with Dan.

            Thanks

            Show
            Ankit Agarwal added a comment - Hi, I did a whole range of testing on ff, chrome, and IE with profiling in all. There was no regressions encountered. The performance change was inconclusive. Subjectively I couldn't tell any difference. Profiling led to varied results, with randomly some times int performing better and sometimes stable. Memory usage did seem a little better(less memory used) in integration, not sure if that is related. Passing after discussing with Dan. Thanks
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Amazed. Inspired. Grateful. That’s how your generosity makes me feel.

            (not really)

            Closing, thanks!

            Show
            Eloy Lafuente (stronk7) added a comment - Amazed. Inspired. Grateful. That’s how your generosity makes me feel. (not really) Closing, thanks!
            Hide
            Petr Skoda added a comment -

            Note: this feature was deprecated upstream, we might remove it in the future, sorry for the bad news...

            Show
            Petr Skoda added a comment - Note: this feature was deprecated upstream, we might remove it in the future, sorry for the bad news...

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: