Back to Cordova

2022 12 14

slack-digest/2022-12-14.md

latest4.3 KB
Original Source

Cordova Slack Digest

Wed, 14 Dec 2022 08:21:27 GMT

User count: 4729

Join the conversation at slack.cordova.io

Channel #jobs (1 messages)


Tue, 13 Dec 2022 15:52:44 GMT

@porto says

Hi guys, I’m looking for a freelancer to help us fix our Android build. Our app is a ReactJS + Cordova and we use Github Actions workflows to generate iOS and Android builds. Unfortunately our build stopped and we’re willing to pay someone to fix it for us. If you’re interested, please DM me

Channel #cordova-electron (24 messages)


Tue, 13 Dec 2022 09:22:07 GMT

@prasunjajodia says

Added a PR for a working electron file plugin https://github.com/apache/cordova-plugin-file/pull/549

Tue, 13 Dec 2022 09:22:27 GMT

@prasunjajodia says

Works on all the projects I own on electron@3

Tue, 13 Dec 2022 09:27:58 GMT

@erisu says

Wonder why it looks complicated in terms of the install and uninstall step compared to say this plugin example:

https://github.com/apache/cordova-plugin-device/pull/135

Tue, 13 Dec 2022 09:32:00 GMT

@erisu says

Based on the

<framework src="src/electron" /> It basically runs npm install src/electron into the electron app.

It will install the necessary deps Defines the serviceName which is linked between the plugins frontend www/*.js code and the backend..

And all of the methods in module.exports of index.js , backend/native side, is exposed to the front within contextIsolation.

Tue, 13 Dec 2022 12:37:22 GMT

@prasunjajodia says

Wait.. You can have node modules imported in your plugin? I thought contextIsolation didn't allow that

Tue, 13 Dec 2022 12:38:11 GMT

@prasunjajodia says

The scripts were made so that we could add a way to expose the required node fs functions

Tue, 13 Dec 2022 13:36:33 GMT

@erisu says

Yeah you can have node modules, but the node modules can not be requires in the front-end code.. its in the native js side.

Tue, 13 Dec 2022 13:37:28 GMT

@erisu says

As you can see in the device plugin PR above am add the system information module.

const { system, osInfo } = require('systeminformation');

Tue, 13 Dec 2022 13:37:34 GMT

@erisu says

and loading it in my native side script

Tue, 13 Dec 2022 13:37:40 GMT

@prasunjajodia says

I'll update my code to do just that and update the PR

Tue, 13 Dec 2022 13:37:50 GMT

@prasunjajodia says

Thanks @erisu

Tue, 13 Dec 2022 13:39:12 GMT

@erisu says

Hopefully my PR will be enough to help. I recall someone requesting to do something specific that was slightly more advance which the currently plugin implementation didn't support. But I feel in terms of what you need it might be enough

Tue, 13 Dec 2022 13:39:42 GMT

@erisu says

you could even use already existing modules under the covers to ensure that you handle multiple OS support.. for example fs-extra

Tue, 13 Dec 2022 13:40:21 GMT

@erisu says

I started to write a blog post,,, * cough *, maybe a year ago hehe, to explain how to make an electron pluigin..

Tue, 13 Dec 2022 13:40:40 GMT

@erisu says

it was never completed cause I needed to review the draft a few times..

Tue, 13 Dec 2022 13:40:49 GMT

@erisu says

but maybe I can link it here if you want to skim it to see if it helps you at all

Tue, 13 Dec 2022 13:40:59 GMT

@prasunjajodia says

That would be super helpful

Tue, 13 Dec 2022 13:41:17 GMT

@prasunjajodia says

I'm thinking of doing a PR for other plugins I use

Tue, 13 Dec 2022 13:41:32 GMT

@prasunjajodia says

So, knowing more stuff will always be a help

Tue, 13 Dec 2022 13:42:38 GMT

@erisu says

Oh it seems I was FAR from completing it 😄 but I will share what I have now anyways

Tue, 13 Dec 2022 13:42:42 GMT

@erisu says

https://erisu.dev/posts/creating-a-plugin-for-apache-cordova-electron/

Tue, 13 Dec 2022 13:42:49 GMT

@erisu says

and I will try to finish it later tomorrow..

Tue, 13 Dec 2022 13:45:14 GMT

@prasunjajodia says

Maybe also post it in https://github.com/apache/cordova/discussions after you're done. This would help a lot

Tue, 13 Dec 2022 13:45:32 GMT

@erisu says

Yeah, will do