Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-10632

Allow executing wiki macro asynchronously

Details

    • Unknown

    Description

      The idea is that some wiki macros (and widgets which are wiki macros) can be both expensive and don't care too much about the XDOM around them and in that case could be loaded asynchronously (with an ajax request a bit like comments for example).

      This require to introduce a few things in the rendering context:

      • the target syntax: making the macro async make sense only of the target is some variant of html
      • enable/disable async: mostly to force non async in cases like pdf and html export

      and in the wiki macro descriptor:

      • enable/disable async: probably safer to disable it by default

      Attachments

        Issue Links

          Activity

            [XWIKI-10632] Allow executing wiki macro asynchronously
            vmassol Vincent Massol added a comment -

            For Context elements, it's not clear how to use it but maybe the screenshot I mentioned will clear the doubt.

            vmassol Vincent Massol added a comment - For Context elements, it's not clear how to use it but maybe the screenshot I mentioned will clear the doubt.
            vmassol Vincent Massol added a comment -

            BTW you have a doc typo on https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/WritingMacros/WikiMacroTutorial/#HDefinition:

            Asynchronous rendering: Since 10.10 Enabled or disable asynchronous rendering of the panel. Disabled by default.

            cf "panel"...

            vmassol Vincent Massol added a comment - BTW you have a doc typo on https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/WritingMacros/WikiMacroTutorial/#HDefinition: Asynchronous rendering: Since 10.10 Enabled or disable asynchronous rendering of the panel. Disabled by default. cf "panel"...
            vmassol Vincent Massol added a comment - tmortagne Thx for the doc. Don't forget to update the screenshot at https://www.xwiki.org/xwiki/bin/download/Documentation/DevGuide/Tutorials/WritingMacros/WikiMacroTutorial/WebHome/macro1.png too

            Another reason is that this is a lot more complex from security point of view. A wiki macro has an author but supporting the same feature for any macro means that you have to decide of the "author" you will use to asynchronously execute that macro.

            tmortagne Thomas Mortagne added a comment - Another reason is that this is a lot more complex from security point of view. A wiki macro has an author but supporting the same feature for any macro means that you have to decide of the "author" you will use to asynchronously execute that macro.
            tmortagne Thomas Mortagne added a comment - - edited

            Why is this only about wiki macros and not java macros?

            The only place where you can manipulate all macros is the macros transformation which is in the rendering. This makes it a lot harder to implement that since rendering would need a whole new set of APIs for that which makes it a totally different scale. I prefer concentrating on wiki macros for now. We can always see later for other macros.

            tmortagne Thomas Mortagne added a comment - - edited Why is this only about wiki macros and not java macros? The only place where you can manipulate all macros is the macros transformation which is in the rendering. This makes it a lot harder to implement that since rendering would need a whole new set of APIs for that which makes it a totally different scale. I prefer concentrating on wiki macros for now. We can always see later for other macros.
            vmassol Vincent Massol added a comment -

            ok, the reason I'm asking is because it says "loading" and wiki macros are loaded only on init (and whenever the wiki macro page itself is modified).

            So this is about execution.

            So does it mean that the page will be rendered and displayed before all macros have been executed and the result of the rendering of these macros will be inserted later on when they're rendered by some other thread?

            Why is this only about wiki macros and not java macros?

            AFAIU it's up to the macro author to decide in its macro descriptor whether the macro can be executed asynchronously or not (I agree that it should be off by default).

            vmassol Vincent Massol added a comment - ok, the reason I'm asking is because it says "loading" and wiki macros are loaded only on init (and whenever the wiki macro page itself is modified). So this is about execution. So does it mean that the page will be rendered and displayed before all macros have been executed and the result of the rendering of these macros will be inserted later on when they're rendered by some other thread? Why is this only about wiki macros and not java macros? AFAIU it's up to the macro author to decide in its macro descriptor whether the macro can be executed asynchronously or not (I agree that it should be off by default).

            How is this related to XWiki init ? The issue is about wiki macros so something executed during a page rendering.

            tmortagne Thomas Mortagne added a comment - How is this related to XWiki init ? The issue is about wiki macros so something executed during a page rendering.
            vmassol Vincent Massol added a comment - - edited

            Is this issue for speeding up xwiki's init time only?

            Or is it about execution (and not loading)?

            vmassol Vincent Massol added a comment - - edited Is this issue for speeding up xwiki's init time only? Or is it about execution (and not loading)?

            People

              tmortagne Thomas Mortagne
              tmortagne Thomas Mortagne
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: