Skip to content

Commit

Permalink
refact(NA): remove dll mentions.
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic committed Nov 16, 2018
1 parent dd2fb28 commit 15a97e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
3 changes: 0 additions & 3 deletions src/optimize/watch/optmzr_role.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import { resolve } from 'path';

import WatchServer from './watch_server';
import WatchOptimizer, { STATUS } from './watch_optimizer';
// import { DllCompiler } from '../dynamic_dll_plugin';
import { fromRoot } from '../../utils'; // TODO: remove when merge with master
import { WatchCache } from './watch_cache';

export default async (kbnServer, kibanaHapiServer, config) => {
Expand All @@ -38,7 +36,6 @@ export default async (kbnServer, kibanaHapiServer, config) => {
watchCache: new WatchCache({
log,
outputPath: config.get('path.data'),
dllsPath: fromRoot('./dlls'), // TODO: replace by DllCompiler.getRawDllConfig().outputPath when merge with master
cachePath: resolve(kbnServer.uiBundles.getCacheDirectory(), '../'),
})
});
Expand Down
19 changes: 2 additions & 17 deletions src/optimize/watch/watch_cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@ import { promisify } from 'util';
import del from 'del';
import deleteEmpty from 'delete-empty';
import globby from 'globby';
import mkdirp from 'mkdirp';

const mkdirpAsync = promisify(mkdirp);
const readAsync = promisify(readFile);
const writeAsync = promisify(writeFile);

interface Params {
log: (tags: string[], data: string) => void;
outputPath: string;
dllsPath: string;
cachePath: string;
}

Expand All @@ -46,7 +43,6 @@ interface WatchCacheStateContent {
export class WatchCache {
private readonly log: Params['log'];
private readonly outputPath: Params['outputPath'];
private readonly dllsPath: Params['dllsPath'];
private readonly cachePath: Params['cachePath'];
private readonly cacheState: WatchCacheStateContent;
private statePath: string;
Expand All @@ -56,7 +52,6 @@ export class WatchCache {
constructor(params: Params) {
this.log = params.log;
this.outputPath = params.outputPath;
this.dllsPath = params.dllsPath;
this.cachePath = params.cachePath;

this.isInitialized = false;
Expand Down Expand Up @@ -103,10 +98,6 @@ export class WatchCache {
// from the previous cache path reset action
await deleteEmpty(this.cachePath);

// delete dlls
await del(this.dllsPath);
await mkdirpAsync(this.dllsPath);

// re-write new cache state file
await this.write();

Expand Down Expand Up @@ -135,14 +126,8 @@ export class WatchCache {

private async buildOptimizerConfigSha() {
const baseOptimizer = resolve(__dirname, '../base_optimizer.js');
const dynamicDllConfigModel = resolve(__dirname, '../dynamic_dll_plugin/dll_config_model.js');
const dynamicDllPlugin = resolve(__dirname, '../dynamic_dll_plugin/dynamic_dll_plugin.js');

return await this.buildShaWithMultipleFiles([
baseOptimizer,
dynamicDllConfigModel,
dynamicDllPlugin,
]);

return await this.buildShaWithMultipleFiles([baseOptimizer]);
}

private isResetNeeded() {
Expand Down

0 comments on commit 15a97e6

Please sign in to comment.