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

[8.0] [Security Solutions] Removes tech debt of exporting all from linter rule for timeline plugin (#120437) #120569

Merged

Conversation

FrankHassanabad
Copy link
Contributor

Backports the following commits to 8.0:

…ule for timeline plugin (elastic#120437)

## Summary

See: elastic#110903

This removes all the top level API `export *` spots from:
* `timeline` plugin within both the common and public section

This reduces the number of metrics and warning about undocumented functions.

I also add this text to timeline:

```
// Careful of exporting anything from this file as any file(s) you export here will cause your page bundle size to increase.
// If you're using functions/types/etc... internally or within integration tests it's best to import directly from their paths
// than expose the functions/types/etc... here. You should _only_ expose functions/types/etc... that need to be shared with other plugins here.

// When you do have to add things here you might want to consider creating a package to share with
// other plugins instead as packages are easier to break down and you do not have to carry the cost of extra plugin weight on
// first download since the other plugins/areas of your code can directly pull from the package in their async imports.
// See: https://docs.elastic.dev/kibana-dev-docs/key-concepts/platform-intro#public-plugin-api
```

# Conflicts:
#	x-pack/plugins/timelines/public/components/actions/timeline/cases/add_to_case_action.tsx
@FrankHassanabad FrankHassanabad enabled auto-merge (squash) December 7, 2021 04:41
@FrankHassanabad FrankHassanabad self-assigned this Dec 7, 2021
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
timelines 287 288 +1

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
timelines 879 377 -502

Any counts in public APIs

Total count of every any typed public API. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats any for more detailed information.

id before after diff
timelines 8 2 -6

Async chunks

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

id before after diff
securitySolution 4.6MB 4.6MB -5.0B
timelines 208.7KB 235.4KB +26.6KB
total +26.6KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
kibana 907 906 -1
timelines 25 37 +12
total +11

Page load bundle

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

id before after diff
securitySolution 243.1KB 243.0KB -98.0B
timelines 164.4KB 135.0KB -29.5KB
total -29.6KB
Unknown metric groups

API count

id before after diff
timelines 1013 441 -572

async chunk count

id before after diff
timelines 16 17 +1

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

cc @FrankHassanabad

@FrankHassanabad FrankHassanabad merged commit dd0744d into elastic:8.0 Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants