|
|
@ -4,7 +4,7 @@ import { CompilerContainerProps, ConfigurationSettings } from './types' |
|
|
|
import * as helper from '../../../../../apps/remix-ide/src/lib/helper' |
|
|
|
import * as helper from '../../../../../apps/remix-ide/src/lib/helper' |
|
|
|
import { canUseWorker, baseURLBin, baseURLWasm, urlFromVersion, pathToURL, promisedMiniXhr } from './logic/compiler-utils' // eslint-disable-line
|
|
|
|
import { canUseWorker, baseURLBin, baseURLWasm, urlFromVersion, pathToURL, promisedMiniXhr } from './logic/compiler-utils' // eslint-disable-line
|
|
|
|
import { compilerReducer, compilerInitialState } from './reducers/compiler' |
|
|
|
import { compilerReducer, compilerInitialState } from './reducers/compiler' |
|
|
|
import { resetCompilerMode, resetEditorMode, listenToEvents } from './actions/compiler' |
|
|
|
import { resetEditorMode, listenToEvents } from './actions/compiler' |
|
|
|
|
|
|
|
|
|
|
|
import './css/style.css' |
|
|
|
import './css/style.css' |
|
|
|
|
|
|
|
|
|
|
@ -85,23 +85,18 @@ export const CompilerContainer = (props: CompilerContainerProps) => { |
|
|
|
switch (compilerContainer.compiler.mode) { |
|
|
|
switch (compilerContainer.compiler.mode) { |
|
|
|
case 'startingCompilation': |
|
|
|
case 'startingCompilation': |
|
|
|
startingCompilation() |
|
|
|
startingCompilation() |
|
|
|
resetCompilerMode()(dispatch) |
|
|
|
|
|
|
|
break |
|
|
|
break |
|
|
|
case 'compilationDuration': |
|
|
|
case 'compilationDuration': |
|
|
|
compilationDuration(compilerContainer.compiler.args) |
|
|
|
compilationDuration(compilerContainer.compiler.args[0]) |
|
|
|
resetCompilerMode()(dispatch) |
|
|
|
|
|
|
|
break |
|
|
|
break |
|
|
|
case 'loadingCompiler': |
|
|
|
case 'loadingCompiler': |
|
|
|
loadingCompiler() |
|
|
|
loadingCompiler() |
|
|
|
resetCompilerMode()(dispatch) |
|
|
|
|
|
|
|
break |
|
|
|
break |
|
|
|
case 'compilerLoaded': |
|
|
|
case 'compilerLoaded': |
|
|
|
compilerLoaded() |
|
|
|
compilerLoaded() |
|
|
|
resetCompilerMode()(dispatch) |
|
|
|
|
|
|
|
break |
|
|
|
break |
|
|
|
case 'compilationFinished': |
|
|
|
case 'compilationFinished': |
|
|
|
compilationFinished() |
|
|
|
compilationFinished() |
|
|
|
resetCompilerMode()(dispatch) |
|
|
|
|
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -239,7 +234,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { |
|
|
|
compileIcon.current.classList.add('remixui_spinningIcon') |
|
|
|
compileIcon.current.classList.add('remixui_spinningIcon') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const compilationDuration = ({ speed }) => { |
|
|
|
const compilationDuration = (speed: number) => { |
|
|
|
if (!warningIcon.current) return |
|
|
|
if (!warningIcon.current) return |
|
|
|
if (speed > 1000) { |
|
|
|
if (speed > 1000) { |
|
|
|
const msg = `Last compilation took ${speed}ms. We suggest to turn off autocompilation.` |
|
|
|
const msg = `Last compilation took ${speed}ms. We suggest to turn off autocompilation.` |
|
|
|