Merge pull request #845 from 0xProject/bug/website/portal-soft-launch-fixes

Enable sourceMaps on Rollbar and fix some small issues
This commit is contained in:
Francesco Agosti
2018-07-10 10:26:40 -07:00
committed by GitHub
9 changed files with 84 additions and 10 deletions

View File

@@ -11,9 +11,12 @@
"clean": "shx rm -f public/bundle*",
"lint": "tslint --project . 'ts/**/*.ts' 'ts/**/*.tsx'",
"watch_without_deps": "webpack-dev-server --content-base public --https",
"deploy_dogfood": "npm run build; aws s3 sync ./public/. s3://dogfood.0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers",
"deploy_staging": "npm run build; aws s3 sync ./public/. s3://staging-0xproject --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers",
"deploy_live": "npm run build; aws s3 sync ./public/. s3://0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers"
"deploy_dogfood":
"npm run build; aws s3 sync ./public/. s3://dogfood.0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers",
"deploy_staging":
"npm run build; aws s3 sync ./public/. s3://staging-0xproject --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers",
"deploy_live":
"npm run build; aws s3 sync ./public/. s3://0xproject.com --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --exclude *.map.js"
},
"author": "Fabio Berger",
"license": "Apache-2.0",
@@ -92,6 +95,7 @@
"less-loader": "^2.2.3",
"make-promises-safe": "^1.1.0",
"raw-loader": "^0.5.1",
"rollbar-sourcemap-webpack-plugin": "^2.3.0",
"shx": "^0.2.2",
"source-map-loader": "^0.1.6",
"style-loader": "0.13.x",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -537,7 +537,9 @@ export class Blockchain {
}
public destroy(): void {
this._blockchainWatcher.destroy();
this._injectedProviderObservable.unsubscribe(this._injectedProviderUpdateHandler);
if (this._injectedProviderObservable) {
this._injectedProviderObservable.unsubscribe(this._injectedProviderUpdateHandler);
}
this._stopWatchingExchangeLogFillEvents();
this._stopWatchingGasPrice();
}

View File

@@ -84,5 +84,5 @@ export interface DifferentWalletSimpleMenuItemProps {
export const DifferentWalletSimpleMenuItem: React.StatelessComponent<DifferentWalletSimpleMenuItemProps> = ({
onClick,
}) => {
return <SimpleMenuItem displayText="Use a Different Wallet..." onClick={onClick} />;
return <SimpleMenuItem displayText="Use Ledger Wallet..." onClick={onClick} />;
};

View File

@@ -33,7 +33,7 @@ export const constants = {
PROVIDER_NAME_TOSHI: 'Toshi',
PROVIDER_NAME_GENERIC: 'Injected Web3',
PROVIDER_NAME_PUBLIC: '0x Public',
ROLLBAR_ACCESS_TOKEN: 'a6619002b51c4464928201e6ea94de65',
ROLLBAR_ACCESS_TOKEN: '32c39bfa4bb6440faedc1612a9c13d28',
S3_DOC_BUCKET_ROOT: 'https://s3.amazonaws.com/doc-jsons',
S3_STAGING_DOC_BUCKET_ROOT: 'https://s3.amazonaws.com/staging-doc-jsons',
SUCCESS_STATUS: 200,

View File

@@ -13,6 +13,14 @@ const rollbarConfig = {
maxItems: 500,
payload: {
environment: configs.ENVIRONMENT,
client: {
javascript: {
source_map_enabled: true,
// This is only defined in production environments.
code_version: process.env.GIT_SHA,
guess_uncaught_frames: true,
},
},
},
uncaughtErrorLevel: 'error',
hostWhiteList: [configs.DOMAIN_PRODUCTION, configs.DOMAIN_STAGING],
@@ -28,7 +36,7 @@ const rollbarConfig = {
'SecurityError (DOM Exception 18)',
],
};
import Rollbar = require('../../public/js/rollbar.umd.nojson.min.js');
import Rollbar = require('../../public/js/rollbar.umd.min.js');
const rollbar = Rollbar.init(rollbarConfig);
export const errorReporter = {

View File

@@ -1,6 +1,13 @@
const path = require('path');
const webpack = require('webpack');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const RollbarSourceMapPlugin = require('rollbar-sourcemap-webpack-plugin');
const childProcess = require('child_process');
const GIT_SHA = childProcess
.execSync('git rev-parse HEAD')
.toString()
.trim();
module.exports = {
entry: ['./ts/index.tsx'],
@@ -80,18 +87,25 @@ module.exports = {
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
GIT_SHA: JSON.stringify(GIT_SHA),
},
}),
// TODO: Revert to webpack bundled version with webpack v4.
// The v3 series bundled version does not support ES6 and
// fails to build.
new UglifyJsPlugin({
sourceMap: true,
uglifyOptions: {
mangle: {
reserved: ['BigNumber'],
},
},
}),
new RollbarSourceMapPlugin({
accessToken: '32c39bfa4bb6440faedc1612a9c13d28',
version: GIT_SHA,
publicPath: 'https://0xproject.com/',
}),
]
: [],
};

View File

@@ -7421,7 +7421,11 @@ lodash.escaperegexp@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz#64762c48618082518ac3df4ccf5d5886dae20347"
lodash.foreach@^4.5.0:
lodash.find@^4.3.0:
version "4.6.0"
resolved "https://registry.npmjs.org/lodash.find/-/lodash.find-4.6.0.tgz#cb0704d47ab71789ffa0de8b97dd926fb88b13b1"
lodash.foreach@^4.2.0, lodash.foreach@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.foreach/-/lodash.foreach-4.5.0.tgz#1a6a35eace401280c7f06dddec35165ab27e3e53"
@@ -7453,6 +7457,10 @@ lodash.merge@^4.6.0:
version "4.6.1"
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.1.tgz#adc25d9cb99b9391c59624f379fbba60d7111d54"
lodash.reduce@^4.3.0:
version "4.6.0"
resolved "https://registry.npmjs.org/lodash.reduce/-/lodash.reduce-4.6.0.tgz#f1ab6b839299ad48f784abbf476596f03b914d3b"
lodash.restparam@^3.0.0:
version "3.6.1"
resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805"
@@ -10374,6 +10382,31 @@ request@^2.54.0, request@^2.67.0, request@^2.79.0:
tunnel-agent "^0.6.0"
uuid "^3.1.0"
request@^2.85.0:
version "2.87.0"
resolved "https://registry.npmjs.org/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e"
dependencies:
aws-sign2 "~0.7.0"
aws4 "^1.6.0"
caseless "~0.12.0"
combined-stream "~1.0.5"
extend "~3.0.1"
forever-agent "~0.6.1"
form-data "~2.3.1"
har-validator "~5.0.3"
http-signature "~1.2.0"
is-typedarray "~1.0.0"
isstream "~0.1.2"
json-stringify-safe "~5.0.1"
mime-types "~2.1.17"
oauth-sign "~0.8.2"
performance-now "^2.1.0"
qs "~6.5.1"
safe-buffer "^5.1.1"
tough-cookie "~2.3.3"
tunnel-agent "^0.6.0"
uuid "^3.1.0"
require-directory@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
@@ -10525,6 +10558,18 @@ rlp@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.0.0.tgz#9db384ff4b89a8f61563d92395d8625b18f3afb0"
rollbar-sourcemap-webpack-plugin@^2.3.0:
version "2.3.0"
resolved "https://registry.npmjs.org/rollbar-sourcemap-webpack-plugin/-/rollbar-sourcemap-webpack-plugin-2.3.0.tgz#47176fd6441d1ce17b4d3c7e9c9cf7f2076b0485"
dependencies:
async "^2.6.0"
babel-runtime "^6.26.0"
lodash.find "^4.3.0"
lodash.foreach "^4.2.0"
lodash.reduce "^4.3.0"
request "^2.85.0"
verror "^1.6.1"
rollbar@^0.6.5:
version "0.6.6"
resolved "https://registry.yarnpkg.com/rollbar/-/rollbar-0.6.6.tgz#8630cff4af967667d06b227f243635ea86dcc5ba"
@@ -12614,7 +12659,7 @@ vendors@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/vendors/-/vendors-1.0.1.tgz#37ad73c8ee417fb3d580e785312307d274847f22"
verror@1.10.0:
verror@1.10.0, verror@^1.6.1:
version "1.10.0"
resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
dependencies: