message for users of < 0.4.12 version``

pull/5370/head
lianahus 4 years ago committed by Liana Husikyan
parent b356404a77
commit 06decd0f87
  1. 17
      apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js

@ -1,4 +1,5 @@
import toaster from '../../ui/tooltip'
import { canUseWorker, baseURLBin, baseURLWasm, urlFromVersion, pathToURL, promisedMiniXhr } from '../../compiler/compiler-utils' import { canUseWorker, baseURLBin, baseURLWasm, urlFromVersion, pathToURL, promisedMiniXhr } from '../../compiler/compiler-utils'
const yo = require('yo-yo') const yo = require('yo-yo')
const helper = require('../../../lib/helper') const helper = require('../../../lib/helper')
@ -210,19 +211,19 @@ class CompilerContainer {
} }
this._view.versionSelector = yo` this._view.versionSelector = yo`
<select onchange="${this.onchangeLoadVersion.bind(this)}" class="custom-select" id="versionSelector" disabled> <select onchange="${() => this.onchangeLoadVersion()}" class="custom-select" id="versionSelector" disabled>
<option disabled selected>${this.data.defaultVersion}</option> <option disabled selected>${this.data.defaultVersion}</option>
<option disabled>builtin</option> <option disabled>builtin</option>
</select>` </select>`
this._view.languageSelector = yo` this._view.languageSelector = yo`
<select onchange="${this.onchangeLanguage.bind(this)}" class="custom-select" id="compilierLanguageSelector" title="Available since v0.5.7"> <select onchange="${() => this.onchangeLanguage()}" class="custom-select" id="compilierLanguageSelector" title="Available since v0.5.7">
<option>Solidity</option> <option>Solidity</option>
<option>Yul</option> <option>Yul</option>
</select>` </select>`
this._view.version = yo`<span id="version"></span>` this._view.version = yo`<span id="version"></span>`
this._view.evmVersionSelector = yo` this._view.evmVersionSelector = yo`
<select onchange="${this.onchangeEvmVersion.bind(this)}" class="custom-select" id="evmVersionSelector"> <select onchange="${() => this.onchangeEvmVersion()}" class="custom-select" id="evmVersionSelector">
<option value="default" selected="selected">compiler default</option> <option value="default" selected="selected">compiler default</option>
<option>muirGlacier</option> <option>muirGlacier</option>
<option>istanbul</option> <option>istanbul</option>
@ -397,7 +398,6 @@ class CompilerContainer {
The following functions map with the above event handlers. The following functions map with the above event handlers.
They are an external API for modifying the compiler configuration. They are an external API for modifying the compiler configuration.
*/ */
setConfiguration (settings) { setConfiguration (settings) {
this.setLanguage(settings.language) this.setLanguage(settings.language)
this.setEvmVersion(settings.evmVersion) this.setEvmVersion(settings.evmVersion)
@ -476,6 +476,15 @@ class CompilerContainer {
this._view.versionSelector.appendChild(option) this._view.versionSelector.appendChild(option)
} }
}) })
if (semver.lt(this._retrieveVersion(), 'v0.4.12+commit.194ff033.js')) {
toaster(yo`
<div>
<b>Old compiler usage detected.</b>
<p>You are using a compiler older than v0.4.12.</p>
<p>Some Functionallity may not work.</p>
</div>`
)
}
// Workers cannot load js on "file:"-URLs and we get a // Workers cannot load js on "file:"-URLs and we get a
// "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium, // "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium,

Loading…
Cancel
Save