Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polkadot identicons #301

Merged
merged 36 commits into from
Aug 6, 2019
Merged

Polkadot identicons #301

merged 36 commits into from
Aug 6, 2019

Conversation

Tbaut
Copy link
Contributor

@Tbaut Tbaut commented Aug 1, 2019

  • bring in @polkadot/reactnative-identicon and the needed wasm deps. Striped down as much as I could. The building time is actually ok the second time (still last a couple min the first time)

  • Set --max_old_space_size=8192 in scripts to avoid out of memory problem

  • upgrade react-native (0.60.4), bignumber.js, hoist-non-react-statics

  • remove some unused deps: react-native-simple-picker, yarn

  • added a sample of identicon, should be removed before merging. It should look like:
    image

@hanwencheng
Copy link
Contributor

find one jest related problem on iOS, which block the building process:

Screenshot 2019-08-02 at 13 26 01

Solved with root directory specification in jest.config.js

following is a simple config file:

module.exports = {
  verbose: true,
  roots: ['<rootDir>/src'],
};

@Tbaut
Copy link
Contributor Author

Tbaut commented Aug 5, 2019

ok I was able to create a signed and fully working apk.. although it takes ages, the building of the metro bundle is long the first time but quite snappy after.

@hanwencheng if you say it's working well on iphone, I'd remove my identicon samples and merge.

@Tbaut Tbaut marked this pull request as ready for review August 5, 2019 13:27
@Tbaut Tbaut requested a review from hanwencheng August 5, 2019 13:27
@hanwencheng
Copy link
Contributor

hanwencheng commented Aug 5, 2019

Got error on iOS

Screenshot 2019-08-05 at 22 55 35

I have tried clear all the mentioned stuff, and the ios build folder, also uninstall the app. It seems the crypto package is not indexed.

shim.js Outdated
// running on VSCode debugger
global.Buffer = undefined
}

Copy link
Contributor

Choose a reason for hiding this comment

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

As we are not using nodify, does these Buffer related code still needed?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1, IIRC the shim.js was generated by the nodify --HACK script right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. It seems that process.browser = true; is still needed though. I removed the rest and things still work.. on android at least 👍

(I get a "process.split undefined" if I remove the process.browser = true;)

@Tbaut
Copy link
Contributor Author

Tbaut commented Aug 6, 2019

As we talked about in person with @hanwencheng, it seems that the 'crypto' override done here isn't picked-up correctly.

I'd advise to try in this order:

  • pull the lastest changes and try again, I removed the crypto import in shim.js, this might help.

if things still don't work:

  • make sure to do a yarn clean, and that all the commands in there work properly (install watchman if needed).

if things still don't work:

Copy link
Contributor

@hanwencheng hanwencheng left a comment

Choose a reason for hiding this comment

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

LGTM, successful tested on iOS simulator

package.json Outdated Show resolved Hide resolved
@@ -0,0 +1 @@
process.browser = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

this isn't a shim anymore, so maybe just set process.browser = true directly in App.js now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤷‍♂️ happy to remove that.

Copy link
Contributor Author

@Tbaut Tbaut Aug 6, 2019

Choose a reason for hiding this comment

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

Copying it in Apps throws

undefined is not and object (evaluating process.version.split)

Not renaming it after discussion because it still is a black magic shim.

Copy link
Contributor

@pmespresso pmespresso left a comment

Choose a reason for hiding this comment

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

looks good to me, just minor comments

@Tbaut Tbaut merged commit 5e0332e into master Aug 6, 2019
@Tbaut Tbaut deleted the tbaut-polkadot-identicons branch September 5, 2019 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants