diff --git a/src/dev/jest/config.json b/src/dev/jest/config.json index e169f562ef338c..2d291e4d909d6b 100644 --- a/src/dev/jest/config.json +++ b/src/dev/jest/config.json @@ -2,7 +2,6 @@ "rootDir": "../../..", "roots": [ "/src/ui", - "/src/ui/public", "/src/core_plugins", "/ui_framework/", "/packages" diff --git a/src/ui/ui_render/bootstrap/app_bootstrap.js b/src/ui/ui_render/bootstrap/app_bootstrap.js index f97308085bad20..c0e797f36fbb96 100644 --- a/src/ui/ui_render/bootstrap/app_bootstrap.js +++ b/src/ui/ui_render/bootstrap/app_bootstrap.js @@ -30,14 +30,9 @@ export class AppBootstrap { } async getJsFileHash() { - if (!this._rawTemplate) { - this._rawTemplate = await loadRawTemplate(); - } - + const fileContents = await this.getJsFile(); const hash = createHash('sha1'); - hash.update(this._rawTemplate); - hash.update(JSON.stringify(this.templateData)); - hash.update(JSON.stringify(this.translations)); + hash.update(fileContents); return hash.digest('hex'); } } diff --git a/src/ui/ui_render/ui_render_mixin.js b/src/ui/ui_render/ui_render_mixin.js index 94c05b0824a4c5..96c389e5a5fff8 100644 --- a/src/ui/ui_render/ui_render_mixin.js +++ b/src/ui/ui_render/ui_render_mixin.js @@ -35,13 +35,13 @@ export function uiRenderMixin(kbnServer, server, config) { path: '/bundles/app/{id}/bootstrap.js', method: 'GET', async handler(request, reply) { - const { id } = request.params; - const app = server.getUiAppById(id); - if (!app) { - return reply(Boom.notFound(`Unknown app: ${id}`)); - } - try { + const { id } = request.params; + const app = server.getUiAppById(id); + if (!app) { + throw Boom.notFound(`Unknown app: ${id}`); + } + const bootstrap = new AppBootstrap({ templateData: { appId: app.getId(),