Skip to content

Commit

Permalink
Rename standalone to entry, fix bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdover committed Apr 9, 2020
1 parent 4aba2c5 commit ef11745
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 30 deletions.
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/src/common/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { BundleCache } from './bundle_cache';
import { UnknownVals } from './ts_helpers';
import { includes, ascending, entriesToObject } from './array_helpers';

const VALID_BUNDLE_TYPES = ['plugin' as const, 'standalone' as const];
const VALID_BUNDLE_TYPES = ['plugin' as const, 'entry' as const];

export interface BundleSpec {
readonly type: typeof VALID_BUNDLE_TYPES[0];
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ it('builds expected bundles, saves bundle counts to metadata', async () => {

expect(
Fs.readFileSync(
Path.resolve(MOCK_REPO_DIR, 'src/core/public/target/public/core.standalone.js'),
Path.resolve(MOCK_REPO_DIR, 'src/core/public/target/public/core.entry.js'),
'utf8'
)
).toMatchSnapshot('core bundle');
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/src/optimizer/get_bundles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ it('returns a bundle for core and each plugin', () => {
"id": "core",
"outputDir": <absolute path>/src/core/public/target/public,
"sourceRoot": <absolute path>,
"type": "standalone",
"type": "entry",
},
Object {
"contextDir": <absolute path>/plugins/foo,
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/src/optimizer/get_bundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { KibanaPlatformPlugin } from './kibana_platform_plugins';

export function getBundles(plugins: KibanaPlatformPlugin[], repoRoot: string) {
const coreBundle = new Bundle({
type: 'standalone',
type: 'entry',
id: 'core',
entry: './public/entry_point',
sourceRoot: repoRoot,
Expand Down
31 changes: 11 additions & 20 deletions src/legacy/ui/ui_render/bootstrap/template.js.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,23 @@ if (window.__kbnStrictCsp__ && window.__kbnCspNotEnforced__) {

// When rendering in Kibana Platform mode, only serve the assets needed by Core.
if ('{{appId}}' === 'core') {
return load({
deps: [
load([
{{#each sharedJsDepFilenames}}
'{{../regularBundlePath}}/kbn-ui-shared-deps/{{this}}',
{{/each}}
'{{regularBundlePath}}/kbn-ui-shared-deps/{{sharedJsFilename}}',
'{{regularBundlePath}}/plugin/kibanaUtils/kibanaUtils.plugin.js',
'{{regularBundlePath}}/plugin/esUiShared/esUiShared.plugin.js',
'{{regularBundlePath}}/plugin/kibanaReact/kibanaReact.plugin.js'
], function() {
load([
'{{regularBundlePath}}/core/core.standalone.js',
{{#each styleSheetPaths}}
'{{this}}',
{{/each}}
])
},
});
'{{regularBundlePath}}/plugin/kibanaReact/kibanaReact.plugin.js',
'{{regularBundlePath}}/core/core.entry.js',
{{#each styleSheetPaths}}
'{{this}}',
{{/each}}
]);
return;
}

load({
deps: [
load([
{{#each sharedJsDepFilenames}}
'{{../regularBundlePath}}/kbn-ui-shared-deps/{{this}}',
{{/each}}
Expand All @@ -101,17 +96,13 @@ if (window.__kbnStrictCsp__ && window.__kbnCspNotEnforced__) {
'{{this}}',
{{/each}}
'{{regularBundlePath}}/commons.bundle.js',
{{!-- '{{regularBundlePath}}/plugin/data/data.plugin.js', --}}
'{{regularBundlePath}}/plugin/kibanaUtils/kibanaUtils.plugin.js',
'{{regularBundlePath}}/plugin/esUiShared/esUiShared.plugin.js',
'{{regularBundlePath}}/plugin/kibanaReact/kibanaReact.plugin.js'
], function () {
load([
'{{regularBundlePath}}/plugin/kibanaReact/kibanaReact.plugin.js',
'{{regularBundlePath}}/{{appId}}.bundle.js',
{{#each styleSheetPaths}}
'{{this}}',
{{/each}}
])
});
]);
};
}

0 comments on commit ef11745

Please sign in to comment.