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

Document view groups #627

Merged
merged 18 commits into from
Jul 9, 2019
Merged

Document view groups #627

merged 18 commits into from
Jul 9, 2019

Conversation

jesusreal
Copy link
Contributor

Description

Changes proposed in this pull request:

  • Add documentation and parameters reference for viewgroups, including caching and preloading

docs/navigation-configuration.md Outdated Show resolved Hide resolved
docs/navigation-parameters-reference.md Outdated Show resolved Hide resolved
## View Groups
You can use the view groups feature to override the default iframes management policy. Imagine you have in your app the following microfrontend views: `http://mysite.com/a#e` and `http://mysite.com/b#f`. Due to hash routing and the fact the path until _#_ differs, they will be rendered in different iframes by default. Nevertheless both views might have the **same origin** (in the example `mysite.com`) and belong to the **same microfrontend** and you will want to render them in the same iframe. The view groups feature makes that possible just by setting the `viewGroup` parameter in the most upper nodes, as their children nodes are automatically considered part of the same view group.

View group nodes are always rendered in their own iframe. Nodes not belonging to any view group will default to the same-origin iframe rendering policy.
Copy link
Contributor

Choose a reason for hiding this comment

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

in their own iframe .. means in a view group iframe?

@maxmarkus maxmarkus self-assigned this Jul 5, 2019
Copy link
Contributor

@bszwarc bszwarc left a comment

Choose a reason for hiding this comment

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

Added comments

```

## View Groups
You can use the view groups feature to override the default iframes management policy. Imagine you have in your app the following microfrontend views: `http://mysite.com/a#e` and `http://mysite.com/b#f`. Due to hash routing and the fact the path until _#_ differs, they will be rendered in different iframes by default. Nevertheless both views might have the **same origin** (in the example `mysite.com`) and belong to the **same microfrontend** and you will want to render them in the same iframe. The view groups feature makes that possible just by setting the `viewGroup` parameter in the most upper nodes, as their children nodes are automatically considered part of the same view group.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can use the view groups feature to override the default iframes management policy. Imagine you have in your app the following microfrontend views: `http://mysite.com/a#e` and `http://mysite.com/b#f`. Due to hash routing and the fact the path until _#_ differs, they will be rendered in different iframes by default. Nevertheless both views might have the **same origin** (in the example `mysite.com`) and belong to the **same microfrontend** and you will want to render them in the same iframe. The view groups feature makes that possible just by setting the `viewGroup` parameter in the most upper nodes, as their children nodes are automatically considered part of the same view group.
The view groups feature allows you to override the default iframes management policy.
Imagine your application hosts two micro front-end views: `http://mysite.com/a#e` and `http://mysite.com/b#f`. Due to hash routing and a different path up to `#`, they are, by default, rendered in different iframes. However, as they both have the **same origin**, such as`mysite.com`, and belong to the **same micro front-end** you want to render them in the same iframe. To achieve that, use the view groups feature. Define the **viewGroup** parameter for top navigation nodes. The children nodes will automatically be considered as part of the same view group.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I commited your suggestion, just replaced "micro front-end" with "micro frontend".

docs/navigation-configuration.md Outdated Show resolved Hide resolved
docs/navigation-configuration.md Outdated Show resolved Hide resolved

Nodes belonging to the same view group are always rendered in their own viewgroup iframe. Nodes not belonging to any view group will default to the same-origin iframe rendering policy.

The view groups feature also offers caching. Caching of view groups is provided out of the box. Everytime you navigate to another view group, either a new iframe is created or if the iframe already exists, it is reused. In both cases, the iframe you are navigating from is not destroyed, but hidden and available to be used again. If you navigate back to the first iframe, and the view in that frame should be updated (e.g. in the second iframe you just added a new entry to a table that should be displayed in the first iframe), you need to set a preload url to any view from the view group to ensure that the view is refreshed when you navigate back to it.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The view groups feature also offers caching. Caching of view groups is provided out of the box. Everytime you navigate to another view group, either a new iframe is created or if the iframe already exists, it is reused. In both cases, the iframe you are navigating from is not destroyed, but hidden and available to be used again. If you navigate back to the first iframe, and the view in that frame should be updated (e.g. in the second iframe you just added a new entry to a table that should be displayed in the first iframe), you need to set a preload url to any view from the view group to ensure that the view is refreshed when you navigate back to it.
The view groups feature also offers out-of-the-box caching. Each time you navigate to another view group, either a new iframe is created or it is reused if already exists. In both cases, the iframe you are navigating from becomes hidden and is available for you to use again.
If you navigate back to the first iframe to update it with new data, such as a new entry in a table in the second iframe that you want to display in the first iframe, you must define a **preloadUrl** parameter for a given view in the view group to ensure that the view is refreshed when you navigate back to it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is great but I didn't apply it completely because the example part was confusing for me. Please check again.

docs/navigation-configuration.md Outdated Show resolved Hide resolved
docs/navigation-configuration.md Outdated Show resolved Hide resolved
docs/navigation-parameters-reference.md Outdated Show resolved Hide resolved
docs/navigation-parameters-reference.md Outdated Show resolved Hide resolved
docs/navigation-parameters-reference.md Outdated Show resolved Hide resolved
docs/navigation-parameters-reference.md Outdated Show resolved Hide resolved
@jesusreal jesusreal merged commit 0080d17 into SAP:master Jul 9, 2019
@jesusreal jesusreal deleted the document-view-groups branch July 9, 2019 08:23
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
documentation documentation tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants