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

Conversation

axelchalon
Copy link
Contributor

@axelchalon axelchalon commented Dec 12, 2018

@amaury1093
Copy link
Collaborator

amaury1093 commented Dec 13, 2018

Reviewing now. Just one small issue, when you yarn electron:

Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file: 

 	/Users/amaurymartiny/Workspaces/fether/node_modules/base-x/index.js:15 

Read more here: http://bit.ly/2tRViJ9

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

    at Promise.all.then.arr (/Users/amaurymartiny/Workspaces/fether/node_modules/lerna/node_modules/execa/index.js:236:11)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)
  code: 1,

It might be solved by #212, not sure if you want to find another package for this, or to wait for #212 first.

Copy link
Collaborator

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

Very nice! Just small comments, and need to solve the uglify problem.

I tested, I can import from bip39 and from parity phrase. Other stuff gives me an error.

if (
words.length < 12 ||
words.length > 24 ||
!words.every(word => PARITY_WORDLIST.has(word))
Copy link
Collaborator

Choose a reason for hiding this comment

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

O(n2). Not a big deal, just putting it here.

createAccountStore.address = '0x123';
createAccountStore.name = 'account name';
createAccountStore.clear();
expect(createAccountStore.phrase).toBe(null);
await createAccountStore.clear();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is await needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, you're right, createAccountStore.clear doesn't return a promise. I'll make it async for consistency

@@ -5,7 +5,8 @@

import React, { Component } from 'react';
import { AccountHeader, Card, Form as FetherForm } from 'fether-ui';
import { inject, observer } from 'mobx-react';
import backupAccount from '../utils/backupAccount';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Relative import in below block

Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

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

This is awesome!! I could test (with a yarn start) and didn't manage to make it crash :)

@axelchalon
Copy link
Contributor Author

axelchalon commented Dec 14, 2018

Updated to CRA2; everything seems to be working fine, although the Electron window opened by yarn start seems to need a refresh to display Fether, not sure why that is.
edit: need to figure out how to add the decorators plugin to the test environment

Copy link
Collaborator

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

Nice! I'll have a look asap

@@ -3,7 +3,9 @@ const { injectBabelPlugin } = require('react-app-rewired');
/* config-overrides.js */
module.exports = function override (config) {
// use the MobX rewire to use @decorators
config = injectBabelPlugin('transform-decorators-legacy', config);

config = injectBabelPlugin(
Copy link
Collaborator

Choose a reason for hiding this comment

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

https://github.com/timarney/react-app-rewired I was a bit worried about this, as they state they don't support CRA2. But hey, it seems to work.

@amaury1093
Copy link
Collaborator

@axelchalon If tests are hard to convert, might be worth giving https://github.com/sharegate/craco a try

Copy link
Collaborator

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

🎉 yarn start, electron and package all work for me!

@axelchalon
Copy link
Contributor Author

ah nice, I think it's best to switch to this then.

Currently react-app-rewired build works fine but react-app-rewired test says "Support for the experimental syntax 'decorators-legacy' isn't currently enabled"

package.json Outdated
@@ -39,15 +39,15 @@
"yarn": "^1.4.2"
},
"scripts": {
"build": "lerna run build",
"build": "cross-env SKIP_PREFLIGHT_CHECK=true lerna run build",
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this needed?

Copy link
Contributor Author

@axelchalon axelchalon Dec 14, 2018

Choose a reason for hiding this comment

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

CRA2 requires a version of eslint (uses a version of eslint internally) that is more recent than the version installed by our dependencies (semistandard); this environment variable suppresses the warning

@axelchalon
Copy link
Contributor Author

axelchalon commented Dec 14, 2018

ready!

I logged the issue of craco test not respecting the --react-scripts path (a flag used to make craco work with monorepos) here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants