-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[autoloading] implement autoloading via modules
Currently there is a long list of modules that is autoloaded for every app. This is because a number of angular directives/filters/services are not properly required by the code that needs them and rather than attempt to track down the relationships between every part of the app and the rest autoloading just makes sure that all of the defined modules are included. Since this was implicit it caused new apps which didn't need anything but chrome styles to be really heavy. This change makes autoloading something you opt into by requiring a ui/autoload/* module. The options include: - `ui/autoload/styles` - include the base styles used by Kibana. This includes all of the styles listed in the ui/styles directory. - `ui/autoload/directives` - `ui/autoload/filters` - `ui/autoload/modules` - include angular and several ui modules that one might expect to be loaded by default. This list is hard coded into this file. - `ui/autoload/all` - includes all of the above lists In order to support this change all plugins will likely need to update and include a `ui/autoload/*` module in their public/index.js file.
- Loading branch information
Showing
13 changed files
with
79 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require('./modules'); | ||
require('./directives'); | ||
require('./filters'); | ||
require('./styles'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const context = require.context('../directives', false, /[\/\\](?!\.|_)[^\/\\]+\.js/); | ||
context.keys().forEach(key => context(key)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const context = require.context('../filters', false, /[\/\\](?!\.|_)[^\/\\]+\.js/); | ||
context.keys().forEach(key => context(key)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
require('angular'); | ||
require('ui/chrome'); | ||
require('ui/chrome/context'); | ||
require('ui/bind'); | ||
require('ui/bound_to_config_obj'); | ||
require('ui/config'); | ||
require('ui/courier'); | ||
require('ui/debounce'); | ||
require('ui/doc_title'); | ||
require('ui/elastic_textarea'); | ||
require('ui/es'); | ||
require('ui/events'); | ||
require('ui/fancy_forms'); | ||
require('ui/filter_bar'); | ||
require('ui/filter_manager'); | ||
require('ui/index_patterns'); | ||
require('ui/listen'); | ||
require('ui/notify'); | ||
require('ui/parse_query'); | ||
require('ui/persisted_log'); | ||
require('ui/private'); | ||
require('ui/promises'); | ||
require('ui/safe_confirm'); | ||
require('ui/state_management/app_state'); | ||
require('ui/state_management/global_state'); | ||
require('ui/storage'); | ||
require('ui/stringify/register'); | ||
require('ui/styleCompile'); | ||
require('ui/timefilter'); | ||
require('ui/tooltip'); | ||
require('ui/typeahead'); | ||
require('ui/url'); | ||
require('ui/validateDateInterval'); | ||
require('ui/watch_multi'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const context = require.context('../styles', false, /[\/\\](?!mixins|variables|_|\.)[^\/\\]+\.less/); | ||
context.keys().forEach(key => context(key)); |