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

Implement TabSheet lazy tabs 3029 #3094

Merged
merged 11 commits into from
Apr 11, 2024

Conversation

ilushaaa
Copy link
Contributor

@ilushaaa ilushaaa commented Apr 3, 2024

@ilushaaa ilushaaa requested a review from glebfox April 3, 2024 15:02
@ilushaaa ilushaaa linked an issue Apr 3, 2024 that may be closed by this pull request
@ilushaaa ilushaaa requested a review from glebfox April 4, 2024 13:47
@ilushaaa ilushaaa requested a review from glebfox April 8, 2024 15:09
@@ -124,6 +164,23 @@ public Component getContent() {
}
}

public static class LazyTabLoader extends TabLoader {
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need it if we don't create it

ComponentLoader<?> componentLoader = loader.getLoader(subElement, TabLoader.class);
componentLoader.initComponent();
boolean shouldBeLazy = loadBoolean(subElement, "lazy").orElse(false) && !firstTab;
ComponentLoader<?> componentLoader = loader.getLoader(subElement,
Copy link
Contributor

Choose a reason for hiding this comment

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

Here we already know if a tab is lazy, so we can skip creating Loader and putting it in pendingLoadComponents. If a tab is lazy, it'd be more efficient to store an element rather than a loader instance. A loader can be created in the selectedTabChangeHandler on demand.

@ilushaaa ilushaaa merged commit ee4681f into master Apr 11, 2024
@ilushaaa ilushaaa deleted the feature/3029-implement-tab-sheet-lazy-tabs branch June 3, 2024 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement TabSheet lazy tabs
2 participants