Skip to content
Spencer edited this page Jan 28, 2016 · 1 revision

Implemented in https://github.com/elastic/kibana/pull/5871

Because of the disconnect between JS modules and angular directives, filters, and services it is difficult to know what you need to import. It is even more difficult to know if you broke something by removing an import that looked unused.

To prevent this from being an issue the ui module provides "autoloading" modules. The sole purpose of these modules is to extend the environment with certain components. Here is a breakdown of those modules:

import 'ui/autoload/styles'
Imports all styles at the root of ‘src/ui/public/styles’
import 'ui/autoload/directives'
Imports all directives in ‘src/ui/public/directives’.
import 'ui/autoload/filters'
Imports all filters in ‘src/ui/public/filters’.
import 'ui/autoload/modules'
Imports angular and several ui services and “components” which Kibana depends on without importing. The full list of imports is hard coded in the module. Hopefully this list will shrink over time as we properly map out the required modules and import them were they are actually necessary.
import 'ui/autoload/all'
Imports all of the above modules.