-
Notifications
You must be signed in to change notification settings - Fork 529
Updates to caching article for app.lifecycle APIs #12565
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
base: main
Are you sure you want to change the base?
Updates to caching article for app.lifecycle APIs #12565
Conversation
Acrolinx ScorecardsWe currently enforce a minimum score of 80. Click the scorecard links for each article to review the Acrolinx feedback on grammar, spelling, punctuation, writing style, and terminology:
More info about Acrolinx Use the Acrolinx extension, or sidebar, in Visual Studio Code to check spelling, grammar, style, tone, clarity, and key terminology when you're creating or updating content. For more information, see Use the Visual Studio Code extension to run Acrolinx locally. |
Learn Build status updates of commit 98ed438:
|
File | Status | Preview URL | Details |
---|---|---|---|
msteams-platform/tabs/how-to/app-caching.md | View | Details | |
msteams-platform/assets/images/saas-offer/cached-launch-app.png | ✅Succeeded | n/a (file deleted or renamed) | |
msteams-platform/assets/images/saas-offer/first-launch-app.png | ✅Succeeded | n/a (file deleted or renamed) | |
msteams-platform/assets/images/tabs/first-launch-app.png | ✅Succeeded | View | |
msteams-platform/assets/images/tabs/suspended-launch-app.png | ✅Succeeded | View |
msteams-platform/tabs/how-to/app-caching.md
- Line 138, Column 4: [Warning: bookmark-not-found - See documentation]
Cannot find bookmark '#enable-app-caching' in 'tabs/how-to/app-caching.md'.
For more details, please refer to the build report.
Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Acrolinx ScorecardsWe currently enforce a minimum score of 80. Click the scorecard links for each article to review the Acrolinx feedback on grammar, spelling, punctuation, writing style, and terminology:
More info about Acrolinx Use the Acrolinx extension, or sidebar, in Visual Studio Code to check spelling, grammar, style, tone, clarity, and key terminology when you're creating or updating content. For more information, see Use the Visual Studio Code extension to run Acrolinx locally. |
Learn Build status updates of commit c648891: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
|
||
* Follow the guidelines in this section to onboard your app to app caching in Teams meeting. For app caching support only in meetings, register the `load` or `beforeUnload` handlers if the context is `sidePanel`. | ||
* App suspension isn't supported for the meeting stage or dialog (referred as task module in TeamsJS v1.x) contexts, because these can be opened on top of the tab and the same iframe or webview can't be used to render the content in the tab and the dialog. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The table in the beginning of the doc shows what frameContext Teams support for caching.
For non-Teams hubs, only FrameContext.Content
will be cached. That means, FrameContext.Task
that is inside Dialog in not supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lakhveerk Added the below entry with the following text, could you let me know if it looks ok?
The table in the introductory section, App suspension for your tab app, provides information about what frameContext
Teams supports for caching. For non-Teams hubs, only FrameContext.Content
is cached. That means, FrameContext.Task
, which is inside Dialog
is not supported.
Acrolinx ScorecardsWe currently enforce a minimum score of 80. Click the scorecard links for each article to review the Acrolinx feedback on grammar, spelling, punctuation, writing style, and terminology:
More info about Acrolinx Use the Acrolinx extension, or sidebar, in Visual Studio Code to check spelling, grammar, style, tone, clarity, and key terminology when you're creating or updating content. For more information, see Use the Visual Studio Code extension to run Acrolinx locally. |
Learn Build status updates of commit 989c8eb: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
Acrolinx ScorecardsWe currently enforce a minimum score of 80. Click the scorecard links for each article to review the Acrolinx feedback on grammar, spelling, punctuation, writing style, and terminology:
More info about Acrolinx Use the Acrolinx extension, or sidebar, in Visual Studio Code to check spelling, grammar, style, tone, clarity, and key terminology when you're creating or updating content. For more information, see Use the Visual Studio Code extension to run Acrolinx locally. |
Learn Build status updates of commit 9c58f04: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
Acrolinx ScorecardsWe currently enforce a minimum score of 80. Click the scorecard links for each article to review the Acrolinx feedback on grammar, spelling, punctuation, writing style, and terminology:
More info about Acrolinx Use the Acrolinx extension, or sidebar, in Visual Studio Code to check spelling, grammar, style, tone, clarity, and key terminology when you're creating or updating content. For more information, see Use the Visual Studio Code extension to run Acrolinx locally. |
Learn Build status updates of commit 0a031c6: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
|
||
App caching improves subsequent launch time of the apps within Teams by allowing you to keep some resources and assets in memory that you can use when rehydrating your app. | ||
When a user navigates away from an app, the app can either be suspended or terminated. Suspension means that the app is sitting in the background and isn't visible to the user. Termination means that the app is completely closed and removed from memory. Suspending an app improves subsequent launch time of the apps within Teams, or other Microsoft 365 products, by allowing you to keep some resources and assets in memory that you can use when you rehydrate your app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a user navigates away from an app, the app can either be suspended or terminated. Suspension means that the app is sitting in the background and isn't visible to the user. Termination means that the app is completely closed and removed from memory. Suspending an app improves subsequent launch time of the apps within Teams, or other Microsoft 365 products, by allowing you to keep some resources and assets in memory that you can use when you rehydrate your app. | |
When a user navigates away from an app, the app can either be suspended or terminated. Suspension means the app functional in the background and isn't visible to the user. Termination means the app is completely closed and removed from memory. Suspending an app improves subsequent launch time of the apps within Teams, or other Microsoft 365 products, by allowing you to keep some resources and assets in memory that you can use when you rehydrate your app. |
|
||
To enable app suspension, follow the steps: | ||
|
||
1. Call [app.lifeCycle.registerBeforeSuspendOrTerminate](/javascript/api/@microsoft/teams-js/app.lifecycle#@microsoft-teams-js-app-lifecycle-registerbeforesuspendorterminatehandler) and [app.lifeCycle.registerOnResumeHandler](/javascript/api/@microsoft/teams-js/app.lifecycle#@microsoft-teams-js-app-lifecycle-registeronresumehandler) APIs. These handlers are required to enable app suspension. Additional information about the [lifecycle module](/javascript/api/@microsoft/teams-js/app.lifecycle) is available in the TeamsJS reference. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Call [app.lifeCycle.registerBeforeSuspendOrTerminate](/javascript/api/@microsoft/teams-js/app.lifecycle#@microsoft-teams-js-app-lifecycle-registerbeforesuspendorterminatehandler) and [app.lifeCycle.registerOnResumeHandler](/javascript/api/@microsoft/teams-js/app.lifecycle#@microsoft-teams-js-app-lifecycle-registeronresumehandler) APIs. These handlers are required to enable app suspension. Additional information about the [lifecycle module](/javascript/api/@microsoft/teams-js/app.lifecycle) is available in the TeamsJS reference. | |
1. Call [app.lifeCycle.registerBeforeSuspendOrTerminate](/javascript/api/@microsoft/teams-js/app.lifecycle#@microsoft-teams-js-app-lifecycle-registerbeforesuspendorterminatehandler) and [app.lifeCycle.registerOnResumeHandler](/javascript/api/@microsoft/teams-js/app.lifecycle#@microsoft-teams-js-app-lifecycle-registeronresumehandler) APIs. These handlers are required to enable app suspension. For more information, see the [lifecycle module](/javascript/api/@microsoft/teams-js/app.lifecycle) available in the TeamsJS reference. |
``` | ||
|
||
> [!NOTE] | ||
> Previously APIs in the `teamsCore` module were used to enable app caching. If an app registers for both `app.lifecycle` and `teamsCore` pairs of handlers, the `app.lifecycle` handlers overwrite the `teamsCore` handlers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> Previously APIs in the `teamsCore` module were used to enable app caching. If an app registers for both `app.lifecycle` and `teamsCore` pairs of handlers, the `app.lifecycle` handlers overwrite the `teamsCore` handlers. | |
> Previously, APIs in the `teamsCore` module were used to enable app caching. If an app registers for both `app.lifecycle` and `teamsCore` pairs of handlers, the `app.lifecycle` handlers overwrite the `teamsCore` handlers. |
@@ -128,67 +150,74 @@ To enable precaching for your tab app, follow these steps: | |||
} | |||
``` | |||
|
|||
> [!NOTE] | |||
> [! | |||
] | |||
> * The `contentUrl` can't contain context-specific parameters, such as team site URL or thread ID, as Teams loads apps with no prior context during launch. | |||
> * The `contentUrl` must be generic enough to load in the background without any user interaction. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
- The
contentUrl
can't contain context-specific parameters, such as team site URL or thread ID, as Teams loads apps with no prior context during launch. - The
contentUrl
must be generic enough to load in the background without any user interaction.
|
||
* Apps need to re-register for events such as `themeChange`, `focusEnter`, and so on, in the load handler. Teams client won't send any notifications to the app when cached. If your app requires notifications even when cached, caching might not be the right solution. | ||
* The suspended app can be used within the same window. The app that is suspended in a pop out window can't be reused in the Main window. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* The suspended app can be used within the same window. The app that is suspended in a pop out window can't be reused in the Main window. | |
* The suspended app can be used within the same window. The app that's suspended in a pop-up window can't be reused in the Main window. |
|
||
* Apps are cached on a per-window basis. App caching happens on a per app (not on a per tab) basis within the same window. | ||
|
||
* App caching isn't supported for the meeting stage or dialog (referred as task module in TeamsJS v1.x) contexts, because these can be opened on top of the tab and the same iframe or webview can't be used to render the content in the tab and the dialog. | ||
* The table in the introductory section, [App suspension for your tab app](#app-suspension-for-your-tab-app), provides information about what `frameContext` Teams supports for caching. For non-Teams hubs, only `FrameContext.Content` is cached. That means, `FrameContext.Task`, which is inside `Dialog` isn't supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* The table in the introductory section, [App suspension for your tab app](#app-suspension-for-your-tab-app), provides information about what `frameContext` Teams supports for caching. For non-Teams hubs, only `FrameContext.Content` is cached. That means, `FrameContext.Task`, which is inside `Dialog` isn't supported. | |
* The table in the introductory section, [App suspension for your tab app](#app-suspension-for-your-tab-app), provides information about what `frameContext` Teams supports for caching. For non-Teams hubs, only `FrameContext.Content` is cached, which means, `FrameContext.Task` that's inside `Dialog` isn't supported. |
Updates article to reflect changes API changes for app caching.
Article is being staged to fascilitate technical review, do not merge.