Build embedded Parity JS properly and separatly (#4426)

* Add a specific embed webpack build // output assets in JSON

* WIP Embed

* Updated Webpack

* Update exports // Webpack config

* Fix app build fail

* Fix NPm scripts

* Reduce Embed dependencies

* Fix NPM exports

* remvoe stats

* Lazy-Load worker (not to load in embed)

* PR Grumbles + Fix tests
This commit is contained in:
Nicolas Gotchac
2017-02-09 15:30:57 +01:00
committed by Jaco Greeff
parent 656c08976f
commit e8175f4cca
26 changed files with 272 additions and 280 deletions

View File

@@ -31,4 +31,4 @@ if (isNode) {
import Etherscan from './3rdparty/etherscan';
module.exports = Etherscan;
export default Etherscan;

View File

@@ -16,4 +16,4 @@
import JsonRpc from './jsonrpc';
module.exports = JsonRpc;
export default JsonRpc;

View File

@@ -32,4 +32,4 @@ if (isNode) {
import Abi from './abi';
import Api from './api';
module.exports = { Api, Abi };
export { Api, Abi };

View File

@@ -31,4 +31,4 @@ if (isNode) {
import ShapeShift from './3rdparty/shapeshift';
module.exports = ShapeShift;
export default ShapeShift;

View File

@@ -20,7 +20,8 @@ import { FormattedMessage } from 'react-intl';
import { IconButton } from 'material-ui';
import { RadioButton, RadioButtonGroup } from 'material-ui/RadioButton';
import { Form, Input, IdentityIcon, PasswordStrength } from '~/ui';
import { Form, Input, IdentityIcon } from '~/ui';
import PasswordStrength from '~/ui/Form/PasswordStrength';
import { RefreshIcon } from '~/ui/Icons';
import styles from '../createAccount.css';

View File

@@ -18,7 +18,8 @@ import { observer } from 'mobx-react';
import React, { Component, PropTypes } from 'react';
import { FormattedMessage } from 'react-intl';
import { Form, Input, PasswordStrength } from '~/ui';
import { Form, Input } from '~/ui';
import PasswordStrength from '~/ui/Form/PasswordStrength';
import styles from '../createAccount.css';

View File

@@ -19,7 +19,8 @@ import React, { Component, PropTypes } from 'react';
import { FormattedMessage } from 'react-intl';
import { Checkbox } from 'material-ui';
import { Form, Input, PasswordStrength } from '~/ui';
import { Form, Input } from '~/ui';
import PasswordStrength from '~/ui/Form/PasswordStrength';
import styles from '../createAccount.css';

View File

@@ -20,7 +20,8 @@ import moment from 'moment';
import React, { Component, PropTypes } from 'react';
import { FormattedMessage } from 'react-intl';
import { Button, Modal, Editor } from '~/ui';
import { Button, Modal } from '~/ui';
import Editor from '~/ui/Editor';
import { CancelIcon, CheckIcon, DeleteIcon } from '~/ui/Icons';
import styles from './loadContract.css';

View File

@@ -23,7 +23,8 @@ import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { newError, openSnackbar } from '~/redux/actions';
import { Button, Modal, IdentityName, IdentityIcon, PasswordStrength } from '~/ui';
import { Button, Modal, IdentityName, IdentityIcon } from '~/ui';
import PasswordStrength from '~/ui/Form/PasswordStrength';
import Form, { Input } from '~/ui/Form';
import { CancelIcon, CheckIcon, SendIcon } from '~/ui/Icons';

View File

@@ -19,7 +19,8 @@ import React, { Component, PropTypes } from 'react';
import SaveIcon from 'material-ui/svg-icons/content/save';
import ContentClear from 'material-ui/svg-icons/content/clear';
import { Button, Modal, Editor, Form, Input } from '~/ui';
import { Button, Modal, Form, Input } from '~/ui';
import Editor from '~/ui/Editor';
import { ERRORS, validateName } from '~/util/validation';
import styles from './saveContract.css';

View File

@@ -0,0 +1,23 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
if (!process.env.EMBED) {
const setupWorker = require('./worker').setupWorker;
module.exports = { setupWorker };
} else {
module.exports = { setupWorker: () => {} };
}

View File

@@ -20,7 +20,7 @@ import initMiddleware from './middleware';
import initReducers from './reducers';
import { load as loadWallet } from './providers/walletActions';
import { setupWorker } from './providers/worker';
import { setupWorker } from './providers/workerWrapper';
import {
Balances as BalancesProvider,

View File

@@ -14,4 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
export Export from './Export';
export Import from './Import';
export Search from './Search';
export Sort from './Sort';
export default from './actionbar';

View File

@@ -14,35 +14,19 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import AddressSelect from './AddressSelect';
import DappUrlInput from './DappUrlInput';
import FormWrap from './FormWrap';
import Input from './Input';
import InputAddress from './InputAddress';
import InputAddressSelect from './InputAddressSelect';
import InputChip from './InputChip';
import InputDate from './InputDate';
import InputInline from './InputInline';
import InputTime from './InputTime';
import Label from './Label';
import RadioButtons from './RadioButtons';
import Select from './Select';
import TypedInput from './TypedInput';
export AddressSelect from './AddressSelect';
export DappUrlInput from './DappUrlInput';
export FormWrap from './FormWrap';
export Input from './Input';
export InputAddress from './InputAddress';
export InputAddressSelect from './InputAddressSelect';
export InputChip from './InputChip';
export InputDate from './InputDate';
export InputInline from './InputInline';
export InputTime from './InputTime';
export Label from './Label';
export RadioButtons from './RadioButtons';
export Select from './Select';
export TypedInput from './TypedInput';
export default from './form';
export {
AddressSelect,
DappUrlInput,
FormWrap,
Input,
InputAddress,
InputAddressSelect,
InputChip,
InputDate,
InputInline,
InputTime,
Label,
RadioButtons,
Select,
TypedInput
};

View File

@@ -14,118 +14,43 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import AccountCard from './AccountCard';
import Actionbar from './Actionbar';
import ActionbarExport from './Actionbar/Export';
import ActionbarImport from './Actionbar/Import';
import ActionbarSearch from './Actionbar/Search';
import ActionbarSort from './Actionbar/Sort';
import Badge from './Badge';
import Balance from './Balance';
import BlockStatus from './BlockStatus';
import Button from './Button';
import Certifications from './Certifications';
import ConfirmDialog from './ConfirmDialog';
import Container, { Title as ContainerTitle } from './Container';
import ContextProvider from './ContextProvider';
import CopyToClipboard from './CopyToClipboard';
import CurrencySymbol from './CurrencySymbol';
import DappCard from './DappCard';
import DappIcon from './DappIcon';
import Editor from './Editor';
import Errors from './Errors';
import Features, { FEATURES, FeaturesStore } from './Features';
import Form, { AddressSelect, DappUrlInput, FormWrap, Input, InputAddress, InputAddressSelect, InputChip, InputDate, InputInline, InputTime, Label, RadioButtons, Select, TypedInput } from './Form';
import GasPriceEditor from './GasPriceEditor';
import GasPriceSelector from './GasPriceSelector';
import Icons from './Icons';
import IdentityIcon from './IdentityIcon';
import IdentityName from './IdentityName';
import LanguageSelector from './LanguageSelector';
import Loading from './Loading';
import MethodDecoding from './MethodDecoding';
import Modal, { Busy as BusyStep, Completed as CompletedStep } from './Modal';
import muiTheme from './Theme';
import Page from './Page';
import ParityBackground from './ParityBackground';
import PasswordStrength from './Form/PasswordStrength';
import Portal from './Portal';
import QrCode from './QrCode';
import SectionList from './SectionList';
import ShortenedHash from './ShortenedHash';
import SignerIcon from './SignerIcon';
import Tags from './Tags';
import Title from './Title';
import Tooltips, { Tooltip } from './Tooltips';
import TxHash from './TxHash';
import TxList from './TxList';
import Warning from './Warning';
export {
AccountCard,
Actionbar,
ActionbarExport,
ActionbarImport,
ActionbarSearch,
ActionbarSort,
AddressSelect,
Badge,
Balance,
BlockStatus,
Button,
Certifications,
ConfirmDialog,
Container,
ContainerTitle,
ContextProvider,
CopyToClipboard,
CurrencySymbol,
DappCard,
DappIcon,
DappUrlInput,
Editor,
Errors,
FEATURES,
Features,
FeaturesStore,
Form,
FormWrap,
GasPriceEditor,
GasPriceSelector,
Icons,
Input,
InputAddress,
InputAddressSelect,
InputChip,
InputDate,
InputInline,
InputTime,
IdentityIcon,
IdentityName,
Label,
LanguageSelector,
Loading,
MethodDecoding,
Modal,
BusyStep,
CompletedStep,
muiTheme,
Page,
ParityBackground,
PasswordStrength,
Portal,
QrCode,
RadioButtons,
Select,
ShortenedHash,
SectionList,
SignerIcon,
Tags,
Title,
Tooltip,
Tooltips,
TxHash,
TxList,
TypedInput,
Warning
};
export AccountCard from './AccountCard';
export Actionbar, { Export as ActionbarExport, Import as ActionbarImport, Search as ActionbarSearch, Sort as ActionbarSort } from './Actionbar';
export Badge from './Badge';
export Balance from './Balance';
export BlockStatus from './BlockStatus';
export Button from './Button';
export Certifications from './Certifications';
export ConfirmDialog from './ConfirmDialog';
export Container, { Title as ContainerTitle } from './Container';
export ContextProvider from './ContextProvider';
export CopyToClipboard from './CopyToClipboard';
export CurrencySymbol from './CurrencySymbol';
export DappCard from './DappCard';
export DappIcon from './DappIcon';
export Errors from './Errors';
export Features, { FEATURES, FeaturesStore } from './Features';
export Form, { AddressSelect, DappUrlInput, FormWrap, Input, InputAddress, InputAddressSelect, InputChip, InputDate, InputInline, InputTime, Label, RadioButtons, Select, TypedInput } from './Form';
export GasPriceEditor from './GasPriceEditor';
export GasPriceSelector from './GasPriceSelector';
export Icons from './Icons';
export IdentityIcon from './IdentityIcon';
export IdentityName from './IdentityName';
export LanguageSelector from './LanguageSelector';
export Loading from './Loading';
export MethodDecoding from './MethodDecoding';
export Modal, { Busy as BusyStep, Completed as CompletedStep } from './Modal';
export muiTheme from './Theme';
export Page from './Page';
export ParityBackground from './ParityBackground';
export Portal from './Portal';
export QrCode from './QrCode';
export SectionList from './SectionList';
export ShortenedHash from './ShortenedHash';
export SignerIcon from './SignerIcon';
export Tags from './Tags';
export Title from './Title';
export Tooltips, { Tooltip } from './Tooltips';
export TxHash from './TxHash';
export TxList from './TxList';
export Warning from './Warning';

View File

@@ -15,7 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import scrypt from 'scryptsy';
import * as Transaction from 'ethereumjs-tx';
import Transaction from 'ethereumjs-tx';
import { pbkdf2Sync } from 'crypto';
import { createDecipheriv } from 'browserify-aes';

View File

@@ -30,7 +30,8 @@ import { newError } from '~/redux/actions';
import { setVisibleAccounts } from '~/redux/providers/personalActions';
import { EditMeta, ExecuteContract } from '~/modals';
import { Actionbar, Button, Page, Modal, Editor } from '~/ui';
import { Actionbar, Button, Page, Modal } from '~/ui';
import Editor from '~/ui/Editor';
import Header from '../Account/Header';
import Delete from '../Address/Delete';

View File

@@ -28,7 +28,8 @@ import ListIcon from 'material-ui/svg-icons/action/view-list';
import SettingsIcon from 'material-ui/svg-icons/action/settings';
import SendIcon from 'material-ui/svg-icons/content/send';
import { Actionbar, ActionbarExport, ActionbarImport, Button, Editor, Page, Select, Input } from '~/ui';
import { Actionbar, ActionbarExport, ActionbarImport, Button, Page, Select, Input } from '~/ui';
import Editor from '~/ui/Editor';
import { DeployContract, SaveContract, LoadContract } from '~/modals';
import WriteContractStore from './writeContractStore';

View File

@@ -14,44 +14,20 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import Account from './Account';
import Accounts from './Accounts';
import Address from './Address';
import Addresses from './Addresses';
import Application from './Application';
import Contract from './Contract';
import Contracts from './Contracts';
import Dapp from './Dapp';
import Dapps from './Dapps';
import HistoryStore from './historyStore';
import ParityBar from './ParityBar';
import Settings, { SettingsBackground, SettingsParity, SettingsProxy, SettingsViews } from './Settings';
import Signer from './Signer';
import Status from './Status';
import Wallet from './Wallet';
import Web from './Web';
import WriteContract from './WriteContract';
export {
Account,
Accounts,
Address,
Addresses,
Application,
Contract,
Contracts,
Dapp,
Dapps,
HistoryStore,
ParityBar,
Settings,
SettingsBackground,
SettingsParity,
SettingsProxy,
SettingsViews,
Signer,
Status,
Wallet,
Web,
WriteContract
};
export Account from './Account';
export Accounts from './Accounts';
export Address from './Address';
export Addresses from './Addresses';
export Application from './Application';
export Contract from './Contract';
export Contracts from './Contracts';
export Dapp from './Dapp';
export Dapps from './Dapps';
export HistoryStore from './historyStore';
export ParityBar from './ParityBar';
export Settings, { SettingsBackground, SettingsParity, SettingsProxy, SettingsViews } from './Settings';
export Signer from './Signer';
export Status from './Status';
export Wallet from './Wallet';
export Web from './Web';
export WriteContract from './WriteContract';