Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewgroup preloading #600

Merged
merged 18 commits into from
Jul 2, 2019
Merged

Viewgroup preloading #600

merged 18 commits into from
Jul 2, 2019

Conversation

pekura
Copy link
Contributor

@pekura pekura commented Jun 21, 2019

No description provided.

@pekura pekura added the enhancement New feature or request label Jun 23, 2019
@jesusreal jesusreal self-assigned this Jun 24, 2019
@pekura pekura added this to the Sprint_1 milestone Jun 24, 2019
@JohannesDoberer JohannesDoberer self-assigned this Jun 24, 2019
@pekura
Copy link
Contributor Author

pekura commented Jun 25, 2019

Implementation details

  • View group preloading is triggered after navigation has changed and the view is rendered (after the microfrontend view sends confirmation to luigi core that the navigation was successful ('luigi.navigation.ok' event) or context was requested ('luigi.get-context' event). This won't affect user experience when clicking on navigation node and it is likely that after that for some time there will be no further interaction with the UI.
  • Only one view group gets preloaded the first time. The subsequent preloading events will decide the batch size (how many view groups get preloaded at once in parallel) based on measured loading time of previously preloaded view groups (if this information is available). The batch size can be 1 to 3. It gets reevaluated each time.
  • If at the time view groups preloading should be triggered there are view groups being loaded the preloading gets skipped completely till next navigation event happens. These throttling measures are there to minimize impact on user perceived responsiveness of the application.

How to test

You need at least on view group configured in the Luigi configuration, better more that one. In navigation section of Luigi config you need to specify it like this:

  viewGroupSettings = {
    ananas: {
      preloadUrl: '/ananasapp.html#/preload',
    },
    tets: {
      preloadUrl: '/tetsapp.html#/preload',
    },
    tets2: {
      preloadUrl: '/tets2app.html#/preload',
    }
}

Preload URL should be rather empty page that includes LuigiClient so that it can react on 'luigi.navigat.ok' event properly!

You also need to mark some navigation nodes to belong to a view group like this:

   {
     category: { label: 'Settings', icon: 'action-settings' },
     pathSegment: 'settings',
     label: 'Project Settings',
     viewUrl: '/sampleapp.html#/projects/' + projectId + '/settings',
    icon: 'settings',
    viewGroup: 'ananas'
   },

Than you can click around in the application and watch iframes with preloaded viewgroups getting preloaded (there are also debug messages to be seen in the console).

Copy link
Contributor

@jesusreal jesusreal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comments below

core/test/utilities/helpers/iframe-helpers.spec.js Outdated Show resolved Hide resolved
core/src/services/iframe.js Outdated Show resolved Hide resolved
core/src/App.html Outdated Show resolved Hide resolved
core/src/services/iframe.js Outdated Show resolved Hide resolved
core/src/services/iframe.js Outdated Show resolved Hide resolved
core/src/services/iframe.js Outdated Show resolved Hide resolved
core/test/services/iframe.spec.js Outdated Show resolved Hide resolved
@jesusreal jesusreal closed this Jun 27, 2019
@jesusreal jesusreal deleted the viewgroup-preloading branch June 27, 2019 11:53
@jesusreal jesusreal restored the viewgroup-preloading branch June 27, 2019 11:55
@jesusreal jesusreal reopened this Jun 27, 2019
@maxmarkus maxmarkus removed this from the Sprint_1 milestone Jul 1, 2019
@pekura pekura merged commit a8c4fad into SAP:master Jul 2, 2019
@pekura pekura deleted the viewgroup-preloading branch July 2, 2019 09:28
stanleychh pushed a commit to stanleychh/luigi that referenced this pull request Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants