[Security solution] Template wrapper fixes, route changes.#212808
[Security solution] Template wrapper fixes, route changes.#212808kqualters-elastic wants to merge 20 commits intoelastic:mainfrom
Conversation
243d765 to
ed80b7b
Compare
|
Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations) |
| <ApplicationUsageTrackingProvider> | ||
| {children ?? | ||
| (subPluginRoutes && <AppRoutes subPluginRoutes={subPluginRoutes} services={services} />)} | ||
| <AppRoutes subPluginRoutes={subPluginRoutes} services={services} /> |
There was a problem hiding this comment.
TODO: Keep this change, render
const { ManagementSettings } = await this.lazyAssistantSettingsManagement();
in a different way
| path: RULES_LANDING_PATH, | ||
| component: RulesLandingPage, | ||
| }, | ||
| // { |
There was a problem hiding this comment.
Please remove commented code
| ]; | ||
|
|
||
| const RulesContainerComponent: React.FC = () => { | ||
| const RulesContainerComponent: React.FC = (props) => { |
There was a problem hiding this comment.
Is this PR still maintained? I can see no actions for 2 months.
💔 Build Failed
Failed CI Steps
Test Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
History
|
seanrathier
left a comment
There was a problem hiding this comment.
Approving: x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/routes.tsx
There was a problem hiding this comment.
clicked around this a bit as well, looking good:) I like the changes though threat intelligence plugin seems to fail
if you can hold this off for a while, we might be able to remove some of the code that allows reconfiguring props on the template for threat intelligence plugin
lgestc
left a comment
There was a problem hiding this comment.
other than failing tests looks alright and seems to improve things a lot, thanks
Hey there! Is this PR currently on hold for this? |
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
Summary
This pr is an attempt at fixing several performance issues in security solution via reworking routes and page templates. In short, the idea behind showTimeline: boolean in security solution sub plugins is currently essentially pointless, as the PluginTemplateWrapper component is destroyed and re-rendered in full any time a user navigates to a new page. With timeline now being based around discover, this results in a whole lot of needlessly duplicated bootstrapping logic running on every page change. This pr changes it so that PluginTemplateWrapper is rendered only once on initially navigating to the security solution, and destroyed when leaving. We probably won't even need showTimeline anymore, but can revisit this later. Navigating from page to page should be significantly faster with this change. Originally this came about from an investigation into an SDH, where I saw a user who had a large amount of fields, try to navigate from 'sub plugin' to 'sub plugin' in security solution rapidly, and the browser would block for upwards of 10 seconds on some pages. Navigation is definitely faster, both in terms of less renders overall and in less renders that block the page for extended periods of time, and nothing should have changed from a user experience point of view. Will update this description with more specific numbers soon. Changes unrelated to the routes and page/plugin wrappers in security solution were mostly found from a combination of why-did-you-render and react devtools.
Checklist