elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.7k stars 8.12k forks source link

Remove `export *` pattern from Data plugin #99515

Open stacey-gammon opened 3 years ago

stacey-gammon commented 3 years ago

export * makes it easy for a developer to accidentally expose functionality on a plugin's public API, and so should be avoided in favor of explicit exports.

Looks like data/common/index.ts has quite a few: https://github.com/elastic/kibana/blob/master/src/plugins/data/common/index.ts#L9

elasticmachine commented 3 years ago

Pinging @elastic/kibana-app-services (Team:AppServices)

lizozom commented 3 years ago

I think that the common export * are intentional, as we expose the explicit APIs from public and server. Isn't it so?

Dosant commented 3 years ago

@lizozom, afaik nothing blocks other's importing from common. Also, they have to import from common if they import into their common. So looks export from common still should be limited.

lizozom commented 3 years ago

Sounds like there's going to be a lot more repeated code then :-) Not sure if I'm a huge fan 🤷🏻

stacey-gammon commented 3 years ago

Any update on this? This is an important step towards reducing the size of the data plugin's public API, which is comprised of 3716 items.

elasticmachine commented 1 year ago

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)