* 0.13

* Only log when asm.js not available

* Flatten checks
This commit is contained in:
Jaco Greeff
2019-07-20 09:56:53 +02:00
committed by GitHub
parent a5ad2fb7a1
commit 794d514909
6 changed files with 22 additions and 23 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
# 0.13.x
# 0.13.1
- Added a build-time optional asm.js fallback for the WASM libraries when WebAssembly is not available, i.e. on React Native. To enable this, add `CRYPTO_ASM=1` to your environment config. (i.e. `CRYPTO_ASM=1 yarn build`)
- Added an asm.js fallback which is active for React Native via the `"react-native"` entry in `package.json`. Ensure that you run the build step with the `NODE_OPTIONS=--max_old_space_size=8192` flags, since the asm.js bundle is large. (For RN the full command would therefore be `NODE_OPTIONS=--max_old_space_size=8192 npm start`)
# 0.12.1
+1 -1
View File
@@ -9,5 +9,5 @@
"packages": [
"packages/*"
],
"version": "0.13.0-beta.4"
"version": "0.13.0"
}
+1 -1
View File
@@ -22,7 +22,7 @@
"devDependencies": {
"@babel/core": "^7.5.4",
"@polkadot/dev": "^0.30.0-beta.23",
"@polkadot/util": "^0.94.0-beta.18",
"@polkadot/util": "^0.94.0-beta.19",
"override-require": "^1.1.1"
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/wasm-crypto",
"version": "0.13.0-beta.4",
"version": "0.13.0",
"author": "Jaco Greeff <jacogr@gmail.com>",
"files": [
"crypto-polyfill.js",
+13 -14
View File
@@ -6,23 +6,22 @@
const pkg = require('./package.json');
const asm = require('./wasm_asm_stub');
const bytes = require('./wasm_wasm');
const js = require('./wasm');
const imports = require('./wasm');
module.exports = async function createExportPromise () {
const imports = {
'./wasm': js
};
try {
const { instance } = await WebAssembly.instantiate(bytes, { './wasm': imports });
if (WebAssembly) {
try {
const { instance } = await WebAssembly.instantiate(bytes, imports);
return instance.exports;
} catch (error) {
console.error(`ERROR: Unable to initialize WebAssembly for ${pkg.name} ${pkg.version}`);
console.error(error);
return instance.exports;
} catch (error) {
// if we have a valid supplied asm.js, return that
if (asm && asm.ext_blake2b) {
return asm;
}
}
return asm;
console.error(`ERROR: Unable to initialize ${pkg.name} ${pkg.version}`);
console.error(error);
return null;
}
};
+4 -4
View File
@@ -2030,10 +2030,10 @@
typescript "^3.5.3"
vuepress "^1.0.2"
"@polkadot/util@^0.94.0-beta.18":
version "0.94.0-beta.18"
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.94.0-beta.18.tgz#363581e1092a1972d1f14df0db18d85a3a27f380"
integrity sha512-SzcKGFeskHQMdrZDnsRQ72lFYkUBWAJBAhjMrpUZR0iMvOSnjaX663034PLr3hvUKunh9W6NjQHJAOrpBgaFfA==
"@polkadot/util@^0.94.0-beta.19":
version "0.94.0-beta.19"
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.94.0-beta.19.tgz#ed2f379cc644e5663941ac9058050e6227bb9c23"
integrity sha512-jJaMPXuCW7Ch+AKvu4YYT39uL2l/JwKL4jPQDO4StVshyOfr5fvpMSGxE2NGbsntFjLqvb0kODIsv2sFdbMF4Q==
dependencies:
"@babel/runtime" "^7.5.5"
"@types/bn.js" "^4.11.5"