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

SceneFlexLayout: Add support for lazy-loading #153

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kaydelaney
Copy link
Contributor

Leaving this as a draft because I have the feeling there are some edge-cases where this breaks down, but it's at least a start.

@kaydelaney kaydelaney added the type/enhancement New feature or request label Apr 18, 2023
@kaydelaney kaydelaney self-assigned this Apr 18, 2023
@bfmatei
Copy link
Contributor

bfmatei commented Apr 24, 2023

Ah, this is something I wanted to point out in one of the feedback threads I posted. Given a multi-page, multi-tab, and a drill-down, the bundle went to ~ 500kb. But we don't need to load everything until the user accesses that area, so lazy loading is more than welcomed.

@@ -86,13 +91,14 @@ interface SceneFlexItemState extends SceneFlexItemPlacement, SceneObjectState {

interface SceneFlexItemRenderProps<T> extends SceneComponentProps<T> {
parentDirection?: CSSProperties['flexDirection'];
isLazy?: boolean;
Copy link
Member

Choose a reason for hiding this comment

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

Think we can make FlexLayout lazy by default. With the latest changes from @torkelo in #156 the parent state is provided via parentState property, so you don't have to include isLazy in the item state.

import { getQueryRunnerWithRandomWalkQuery, getEmbeddedSceneDefaults } from './utils';
import { DebugItem } from './flexLayout';

export function getLazyFlexDemo(defaults: SceneAppPageState) {
Copy link
Member

Choose a reason for hiding this comment

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

I couldn't get this demo show the lazy loading. So i've tried panel repeater demo with ridiculous 100 repeats and it seems like that demo doesn't render the timeseries viz anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement New feature or request
Projects
Status: 🚫 Blocked
Development

Successfully merging this pull request may close these issues.

None yet

4 participants