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

Apps/App Switcher #4335

Merged
merged 152 commits into from Jul 30, 2015
Merged

Apps/App Switcher #4335

merged 152 commits into from Jul 30, 2015

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Jun 26, 2015

This upgrades node.js to io.js version 2.4. I recommend using https://github.com/wbyoung/avn to keep things up to date.

Closes #4218
Closes #4267
Closes #4387
Closes #3278
Closes #4242
Closes #4254
Closes #4268

Directory Structure

One of the biggest changes in this pr is the directory structure. Things have been shuffled around, but most files will still be found next to their previous neighbors. Here is a rough idea of the change in structure:

current new
src/
  kibana/
    components/
      vislib/
      filter_bar/
      doc_table/
      ...
    plugins/
      kibana/
      discover/
      visualize/
      markdown_vis/
      ...
    filters/
    directives/
    factories/
    index.js
    require.config.js
  server/
    bin/
      plugins/
      plugin/
      startup/
      kibana.{js,sh,bat}
    plugins/
  ...
test/
  unit/
    specs/
      
bin/
  kibana
  kibana.bat
installed_plugins/
src/
  cli/
    plugin/
    serve/
    cli.js
  plugins/
    kibana/
      discover/
      visualize/
      markdown_vis/
    ...
  ui/
    __tests__
    vislib/
      __tests__
    filter_bar/
      __tests__
    doc_table/
      __tests__
    ...
    filters/
    directives/
    factories/
  server/
    ...
            
  • src/ui contains the modules building the base "kibana framework".
  • components/* modules are now a part of the ui module
    • components/courier => ui/courier
    • components/vislib => ui/vislib
  • tests are now next to the files they test
  • the src/ directory now contains just source code, no bower_components and no plugins

bin/kibana

The kibana executable now serves as the dev server as well as the build system. The server's plugin mechanism is backed by webpack, which is used to create bundles that can be rebuilt anytime plugins are installed, removed, or updated and that action is carried out by the server.

plugin structure

Each plugin is made up of at least files:

  • index.js defines the plugin with code, teaching the server about any ui-exports it provides, and allowing the plugin to hook into the server itself so customization.
  • package.json defines the id and version of the plugin. This file can also be used to install dependencies for a plugin or execute postInstall steps like building or transpiling files.

webpack

Webpack is used to bundle the files of one plugin with the ui framework and the exports of another plugin into an app. The rules for configuring webpack are designed to cover the majority of use-cases, but customizing webpack is possible by specifying module: or loaders: ui-exports options.

bin/kibana --dev

The kibana executable includes a dev mode causes the server to fork two child processes, one that executes the optimizer and rebuild the app bundles as needed and the other that runs the server. The parent process also watches the server's source files and restarts the server process when a change is detected.

tests

As mentioned earlier, tests have moved from a single test directory into small test directories which live next to the code they test. These directories are bundled on the fly and are only accessible when the server is run in --dev mode.

@spalger spalger force-pushed the apps/home branch 2 times, most recently from 9bedf6b to 6689d75 Compare July 29, 2015 20:58
@spalger spalger force-pushed the apps/home branch 5 times, most recently from f3cfdb1 to 388d102 Compare July 29, 2015 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants