-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[visualizations] lazy load actions #207147
Conversation
/ci |
/ci |
/ci |
/ci |
@elasticmachine merge upstream |
There are no new commits on the base branch. |
/ci |
1 similar comment
/ci |
/ci |
Pinging @elastic/kibana-presentation (Team:Presentation) |
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.
packages/kbn-optimizer/limits.yml
LGTM
@elasticmachine merge upstream |
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.
All good for me code wise, yested also locally, the chunk is async loaded
uiActions.addTriggerActionAsync(CONTEXT_MENU_TRIGGER, ACTION_EDIT_IN_LENS, async () => { | ||
const { EditInLensAction } = await import('./actions_module'); | ||
return new EditInLensAction(data.query.timefilter.timefilter); | ||
}); | ||
|
||
uiActions.addTriggerActionAsync(ADD_PANEL_TRIGGER, ADD_AGG_VIS_ACTION_ID, async () => { | ||
const { AddAggVisualizationPanelAction } = await import('./actions_module'); | ||
return new AddAggVisualizationPanelAction(types); | ||
}); |
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.
Instead of importing the actions_modules
isn't better to directly import the Action directly from its file?
Since we are async loading these to reduce a bit the initial loading we can probably also gain a bit during the action loading if we async load the Actions independently, WDYT?
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.
that makes sense since the actions are for different triggers. Resolved with 4bcd8f0
@@ -18,7 +18,7 @@ export type HasVisualizeConfig = HasType<'visualization'> & { | |||
export const apiHasVisualizeConfig = (api: unknown): api is HasVisualizeConfig => { | |||
return Boolean( | |||
api && | |||
apiIsOfType(api, 'visualization') && | |||
(api as HasType)?.type === 'visualization' && |
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.
why this change?
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.
avoid using apiIsOfType
to avoid importing presentation-publishing package into page load. Since apiIsOfType
is so simple, no reason to use the utility method and import such a huge bundle just for it.
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsTest FailuresMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
async chunk count
References to deprecated APIs
History
|
Starting backport for target branches: 8.x |
Clean up visualizations page load size by * lazy loading actions * avoid exporting from index files to avoid exporting unused code * move `urlFor` and `getFullPath` into `url_utils` to avoid including `utils/saved_visualize_utils` in page load bundle --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit d7f801a)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [[visualizations] lazy load actions (#207147)](#207147) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nathan Reese","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-23T18:33:23Z","message":"[visualizations] lazy load actions (#207147)\n\nClean up visualizations page load size by\r\n* lazy loading actions\r\n* avoid exporting from index files to avoid exporting unused code\r\n* move `urlFor` and `getFullPath` into `url_utils` to avoid including\r\n`utils/saved_visualize_utils` in page load bundle\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"d7f801ab3e9c22cc77c0fc3da9492008a5a5252a","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","release_note:skip","v9.0.0","project:embeddableRebuild","backport:version","v8.18.0"],"title":"[visualizations] lazy load actions","number":207147,"url":"https://github.com/elastic/kibana/pull/207147","mergeCommit":{"message":"[visualizations] lazy load actions (#207147)\n\nClean up visualizations page load size by\r\n* lazy loading actions\r\n* avoid exporting from index files to avoid exporting unused code\r\n* move `urlFor` and `getFullPath` into `url_utils` to avoid including\r\n`utils/saved_visualize_utils` in page load bundle\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"d7f801ab3e9c22cc77c0fc3da9492008a5a5252a"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/207147","number":207147,"mergeCommit":{"message":"[visualizations] lazy load actions (#207147)\n\nClean up visualizations page load size by\r\n* lazy loading actions\r\n* avoid exporting from index files to avoid exporting unused code\r\n* move `urlFor` and `getFullPath` into `url_utils` to avoid including\r\n`utils/saved_visualize_utils` in page load bundle\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"d7f801ab3e9c22cc77c0fc3da9492008a5a5252a"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Nathan Reese <[email protected]>
Clean up visualizations page load size by * lazy loading actions * avoid exporting from index files to avoid exporting unused code * move `urlFor` and `getFullPath` into `url_utils` to avoid including `utils/saved_visualize_utils` in page load bundle --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Clean up visualizations page load size by * lazy loading actions * avoid exporting from index files to avoid exporting unused code * move `urlFor` and `getFullPath` into `url_utils` to avoid including `utils/saved_visualize_utils` in page load bundle --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Clean up visualizations page load size by
urlFor
andgetFullPath
intourl_utils
to avoid includingutils/saved_visualize_utils
in page load bundle