Skip to content

[securitySolutions] resolve most @kbn/imports/no_boundary_crossing violations#137694

Merged
spalger merged 7 commits intoelastic:mainfrom
spalger:fix/security-solutions-boundary-crossings
Aug 10, 2022
Merged

[securitySolutions] resolve most @kbn/imports/no_boundary_crossing violations#137694
spalger merged 7 commits intoelastic:mainfrom
spalger:fix/security-solutions-boundary-crossings

Conversation

@spalger
Copy link
Copy Markdown
Contributor

@spalger spalger commented Aug 1, 2022

This PR addresses most of the @kbn/imports/no_boundary_crossing violations which were highlighted by #136911.

These changes fall into two categories:

  1. mocks were being re-exported from index.ts files which included them in the bundled browser code or server code unnecessarily

    to fix these the re-exports were just removed and the imports using these were updated to import from .../mocks instead

  2. mocks were being used to demonstrate specific events in the "Customize Event Renderers" view, which meant that test code was being included in browser bundles

    to fix these the mocks necessary in the browser were moved to a new "demo_data" directory, and where then re-exported from the "mocks" so that copious test imports could be left untouched.

The bundle metrics highlight the benefit of these changes, removing over 200 modules from the browser bundle and hundreds of KB from the async chunks. Additionally, these changes will enable us to maintain separate dependency trees for the tests in security solutions automatically, leading us to better support for incremental tasks in future versions of the packaging system.

There is one remaining issue that I need to brainstorm with someone (likely @oatkiller, based on his work in #75799) but we can take care of that in a separate step.

@spalger spalger force-pushed the fix/security-solutions-boundary-crossings branch 4 times, most recently from 97ef9d6 to ffa2a96 Compare August 2, 2022 15:28
@spalger spalger changed the title [securitySolutions] resolve @kbn/imports/no_boundary_crossing violations [securitySolutions] resolve most @kbn/imports/no_boundary_crossing violations Aug 2, 2022
@spalger spalger force-pushed the fix/security-solutions-boundary-crossings branch from ffa2a96 to e468c93 Compare August 2, 2022 17:05
@spalger spalger added Team:Operations Kibana-Operations Team release_note:skip Skip the PR/issue when compiling release notes labels Aug 2, 2022
@spalger spalger marked this pull request as ready for review August 2, 2022 18:12
@spalger spalger requested review from a team as code owners August 2, 2022 18:12
@spalger spalger requested review from dasansol92 and pzl August 2, 2022 18:12
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@spalger spalger added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Aug 4, 2022
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 3251 3034 -217

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 5.6MB 5.4MB -246.7KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
securitySolution 254.7KB 254.5KB -177.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 419 400 -19

Total ESLint disabled count

id before after diff
securitySolution 495 476 -19

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@paul-tavares paul-tavares left a comment

Choose a reason for hiding this comment

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

Thanks for doing this @spalger . Looks good from a security solution Onboarding and Lifecycle Management team

@spalger spalger merged commit e49c864 into elastic:main Aug 10, 2022
@spalger spalger deleted the fix/security-solutions-boundary-crossings branch August 10, 2022 21:34
@kibanamachine kibanamachine added v8.5.0 backport:skip This PR does not require backporting labels Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Operations Kibana-Operations Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants