- start in Kibana root (shown as "{root}/" throughout below)
yarn build -> scripts.build -> node scripts/build --all-platforms- build script requires
'{root}/src/dev/build/cli' - the cli file manages a bunch of initial CLI flags, then calls
buildDistributables() buildDistributablesruns many build tasks, including theOptimizeBuildTask- the optimize task runs the kibana binary with the optimize flag:
{root}/bin/kibana --env.name=production --logging.json=false --optimize - the kibana binary checks that you have a node binary in
{root}/node/bin/node, then invokes the{root}/src/clifile - if there is no "subcommand" (concept from "commander" package, e.g. "bin/kibana something"), it will splice in the "serve" subcommand for you
- the "commander" package parses the CLI arguments and runs "serve", set up by the
serveCommand(program)call serveCommand()sets up the "serve" command- "serve" does a lot of configuration and option defaulting and management, then ultimately runs
bootstrap() - the bootstrap method creates a new "Root" and calls its
startmethod - the
Rootobject creates a newServerinstance and assigns it tothis.server, then theRoot#startmethod callsthis.server.start - the
Serverobject creates a number of things on instantiation, one being aLegacyCompatModuleinstance which it assigns tothis.legacy- https://github.com/elastic/kibana/blob/master/src/core/server/index.ts#L45
- I believe this
LegacyCompatModuleis the "old platform"? PluginsModuleassigned tothis.pluginsmight be the "new platform"?
- the
Server#startmethod callsthis.legacy.service.start() this.legacy.serviceis aLegacyServiceinstance- the
LegacyService#startmethod creates a newkbnServerwhich requires in the{root}/src/server/kbn_serverfile - the
KbnServerconstructor sets up a list of "mixins", or functions that will be called in order -- one is theOptimizeMixin - mixins are each called with
this, this.server, this.config - the
OptimizeMixinhandles watch mode etc., and creates a newFsOptimizer FsOptimizerextends from theBaseOptimizer- the
BaseOptimizersets up webpack!
Last active
November 26, 2018 18:44
-
-
Save jasonrhodes/a6b7267ab8db24626bc6bdfa350975dc to your computer and use it in GitHub Desktop.
Schoolhouse Rock: How a Kibana becomes a build (specifically client-side webpack)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment