Uploaded image for project: 'Fluid Infusion'
  1. Fluid Infusion
  2. FLUID-5676

Renderer should return to applying jQuery.empty() when blasting old markup, to ensure that UI widgets are properly disposed

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Renderer
    • Labels:
      None

      Description

      Long ago, we decided to sideline the standard jQuery pipeline for removing markup from the document, based on $.remove() and $.empty() - in the days of CollectionSpace, we were faced with extremely large UIs for which the cost of $.empty() was too high, particularly in Firefox. At least on the supported browsers at that time, assigning "" to innerHTML was found to be orders of magnitude faster and adequately stable - although it seems we still have a very old switch which continues to use $.empty() on IE presumably for reasons of stability.

      https://github.com/fluid-project/infusion/blob/master/src/framework/renderer/js/fluidRenderer.js#L1497

      Today in work on the First Discovery tool we encountered YET ANOTHER tooltip accumulation bug, triggered by the fact that we were obliterating the markup holding a button over which a tooltip was displayed as part of the early part of renderer workflow - and only later trying to call the Infusion destructor for the component wrapping it, which was then no longer able to communicate to jQuery UI which tooltip should be destroyed.

      The performance impact of $.empty() has probably ceased to be significant years ago, and we should just switch back to using it on all platforms. Note that during that era, jQuery UI destructors couldn't be relied upon to work reliably in any case: https://forum.jquery.com/topic/jquery-empty-does-not-destroy-ui-widgets-whereas-jquery-remove-does-using-ui-1-8-4

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              antranig Antranig Basman
              Reporter:
              antranig Antranig Basman
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: