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

deasync #6

Open
Delfshkrimm opened this issue Oct 6, 2020 · 5 comments
Open

deasync #6

Delfshkrimm opened this issue Oct 6, 2020 · 5 comments

Comments

@Delfshkrimm
Copy link

Delfshkrimm commented Oct 6, 2020

Hi,

Thanks for the amazing work on nodejs-mobile! This is truly amazing.

I'm currently trying to have the npm module deasync built for android, using the nodejs-mobile-react-native plugin, but it normally installs using a custom build.js shell script (see package.json).
As stated here, the current implementation for building native modules in nodejs-mobile-react-native requires extra work when not directly using node-gyp.

I wonder what needs to be done for react-native run-android to detect that deasync needs to be compiled using the android toolchains, and how to make it work using their build.js script (I already manage to have this work for more common native modules like leveldown that uses vanilla node-gyp in its install script)/

Thank you in advance

@frank-dspeed
Copy link

it does not detect that you ship it pre build normaly

@Delfshkrimm
Copy link
Author

Hi! Thanks for your answer @frank-dspeed

I know, the react native gradle script detects that deasync is a native module, but won't compile it against the 4 default toolchains during building process (whereas I have no pb with other modules such as leveldown and ursa)... I think it's because it doesn't use node-gyp in its install script from package.json, but rather use a build.js script (found at the root level: https://github.com/abbr/deasync/blob/master/build.js)

If I refer to the Limitations and future work section of this blog article, this is the expected behavior and needs a bit of tweaking:

Modules that have non-standard build steps (e.g. depending on shell scripts rather than node-gyp, for building) may require further changes to work on mobile.

My question is then: how can I tweak the package.json of deasync or the build.gradle scripts to just make it work?
Thank you!

@frank-dspeed
Copy link

@Delfshkrimm as wrote on the page that is work that needs to get done but i told you already what needs to get done you prebuild them and ship them.

@frank-dspeed
Copy link

and maybe overall more importent i should say that this deasync is scary ..... no one should use that its from a time where we did not got promises and async await and we did not got execSync which we got now so overall it is .... you should forget it anyway.

@Delfshkrimm
Copy link
Author

Delfshkrimm commented Oct 14, 2020

Ah yes thank you! Didn't think of that, you're right. I'll try and figure out the right options from the build script in the nodejs-mobile-react-native package to match how it's done, but on my side.

And yes you're also right, deasync is terrible and this is a temporary only thing I have to do while refactoring the parts of the app I need to fully remove deasync.

Again thanks for your help!

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

No branches or pull requests

2 participants