Skip to content
This repository was archived by the owner on Mar 16, 2022. It is now read-only.

Conversation

@epiqueras
Copy link
Contributor

This PR hopefully finalizes the boilerplate standard for now.

I also went around and standardized import/exports to follow a common standard (The index files in utils/components were causing Webpack to choke up when ran though jest or storybook because of circular dependencies):

  • import regular named exports directly from their file using destructuring import syntax
    e.g.
import { name } from '.../utils/something'
  • import actions, selectors, and shapes using the * as syntax
    e.g.
import * as somethingActions from '.../actions/something'

somethingActions.FETCH_SOMETHING
somethingActions.fetchSomething()
import * as somethingSelectors from '.../reducers/something'

somethingSelectors.somethingShape.isRequired
somethingSelectors.getSomething(state)

@coveralls
Copy link

coveralls commented Jan 23, 2018

Pull Request Test Coverage Report for Build 12

  • 61 of 61 (100.0%) changed or added relevant lines in 14 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+94.3%) to 95.098%

Totals Coverage Status
Change from base Build 7: 94.3%
Covered Lines: 126
Relevant Lines: 126

💛 - Coveralls

@epiqueras epiqueras requested review from n1c01a5 and satello January 23, 2018 20:51
Copy link

@satello satello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! My biggest overarching concern is there is quite a bit of code in here that currently wouldn't be used in the DApp such as the all the eth balance stuff and some of the utils and helpers. If we think we will never use it its probably worth it to take it out to reduce the clutter

README.md Outdated
DEV_ARBITRATOR_ADDRESS=0xaea35f89f98996ae06aac344ab4b9ce1731059c4
REACT_APP_DEV_ETHEREUM_PROVIDER=http://localhost:8545
REACT_APP_DEV_STORE_PROVIDER=https://kleros.in
REACT_APP_DEV_ARBITRATOR_ADDRESS=0xaea35f89f98996ae06aac344ab4b9ce1731059c4
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This address has changed. I think you might just want to leave this blank in the boilerplate as it is likely to change a lot

import * as walletSelectors from '../reducers/wallet'
import { eth } from './kleros'
import { renderIf } from '../utils/react-redux'
import RequiresMetaMask from '../components/requires-meta-mask'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like components being PascalCase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean I should change the filename/path? Or is this good?

The only reason I made the filename kebab-case was so we can enforce a consistent filename pattern with the linter. Otherwise it would be up to us to make sure only component files have PascalCase filenames. I guess it's not that bad. What do you think?

const { isWeb3Loaded } = this.state
const { accounts, children } = this.props

return renderIf(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice


export default new Kleros(web3.currentProvider, process.env.STORE_PROVIDER)
export { eth }
export default new Kleros(eth.currentProvider, process.env.STORE_PROVIDER)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

export const WEB3_NOT_RESOLVED =
'The object `web3` was not found. Maybe try to install Metamask https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=en'
export const ETH_NO_ACCOUNTS =
'web3 accounts were not found. Maybe try installing MetaMask: https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=en'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the wording should be something like web3 accounts not found. Do you have MetaMask installed? ...

@@ -1,31 +1,71 @@
import React, { PureComponent } from 'react'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this balance page for? is it just an example container?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I needed an example container so I could write an integration test with the whole redux saga fetch/loading/{receive,failed} flow.

@epiqueras
Copy link
Contributor Author

epiqueras commented Jan 24, 2018

@satello
I changed the readme .env file to use placeholders.

I changed the ETH_NO_ACCOUNTS message.

I got rid of all the utils that are not being used. Do you think there is anything else I should remove?

I also made the app more "generic" by changing bootstrap/kleros.js to bootstrap/dapp-api.js.

newState = { ...newState, ['loading' + resource]: false }
for (const actionTypePrefix of Object.keys(automaticActionPluginMap)) {
const l = actionTypePrefix.length
const a = action.type.slice(0, l)
Copy link
Contributor

@n1c01a5 n1c01a5 Jan 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the name var l or a it's not very explicit

@n1c01a5
Copy link
Contributor

n1c01a5 commented Jan 24, 2018

@satello I disagree with the ETH balance component most of dapp are need this metric and I think it's good to have an concrete interaction with the blockchain

@n1c01a5
Copy link
Contributor

n1c01a5 commented Jan 24, 2018

@epiqueras good work

@n1c01a5 n1c01a5 merged commit 4385155 into master Jan 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants