slack-digest/2020-11-27.md
Fri, 27 Nov 2020 08:29:23 GMT
Join the conversation at slack.cordova.io
Thu, 26 Nov 2020 21:46:00 GMT
@mathewp.94 says
What determines the order that plugins run their
after-preparehooks in?
Thu, 26 Nov 2020 21:46:04 GMT
@mathewp.94 says
Is it just install order?
Thu, 26 Nov 2020 21:50:07 GMT
@mathewp.94 says
I need to update my
AndroidManifest.xmlbut the section I need to update is overwritten by anafter-preparehook that a plugin is running, so I figure the only ways to get around this are:
- Create a plugin so I can run an
after-preparehook after the other plugin runs it's hook- Just write a script that I manually run after I run
cordova prepare android- I guess I could also write a script that runs
cordova prepare androidand then modifies the XML if I feel especially lazy
Thu, 26 Nov 2020 22:03:32 GMT
@norman137 says
getHookScripts:// args check if (!hook) { throw new Error('hook type is not specified'); } return getApplicationHookScripts(hook, opts) .concat(getPluginsHookScripts(hook, opts)); }``` I'm not really familiar with that part of the codebase yet, but it looks like it always runs application hooks first, then plugin hooks. Out of those methods, the order appears to come in the order they are defined in the `config.xml` or `plugin.xml` file, but I don't think there is any defined order on which plugin has their hooks ran before another plugin.
Thu, 26 Nov 2020 22:05:24 GMT
@norman137 says
Instead of using the
after_preparehook, you could try using*before_buildinstead*
Thu, 26 Nov 2020 22:08:20 GMT
@norman137 says
Or
before_compile... not quite sure what the difference between a build hook and a compile hook is tbh 😕
Thu, 26 Nov 2020 22:09:56 GMT
@norman137 says
https://cordova.apache.org/docs/en/latest/guide/appdev/hooks/#example-2-cordova-build
Thu, 26 Nov 2020 22:12:34 GMT
@dpogue says
The order is not random, but I don't think it's defined or documented exactly what the order is
Thu, 26 Nov 2020 22:13:18 GMT
@dpogue says
My guess is either the order they're listed in package.json's
cordovasection, or alphabetically
Thu, 26 Nov 2020 22:19:27 GMT
@mathewp.94 says
https://www.damirscorner.com/blog/posts/20170728-OrderOfCordovaPluginsMatters.html Seems it might be determined by the install order
Thu, 26 Nov 2020 22:40:00 GMT
@norman137 says
I don't think that's 100% correct... or maybe it's no longer the case because when searching for plugins it does this...
//const pluginXmlPaths = glob.sync('{,@*/}*/plugin.xml', { cwd: absPath, nodir: true, absolute: true }).map(path.normalize);``` So whatever order this glob gives is when scanning the file system directory is whatever order the plugin xml paths will be loaded in to look for hooks. The order of `glob.sync` will probably end up being whatever order the OS gives you when listing directory contents, which I think is generally alphabetical.
Thu, 26 Nov 2020 22:41:45 GMT
@mathewp.94 says
Interesting, good to know
Thu, 26 Nov 2020 23:06:03 GMT
@mathewp.94 says
Doing more digging, it looks like there could be potential for bugs here: https://github.com/apache/cordova-lib/blob/919dfed6b830ec9332ecf00acc15fea411cdca90/src/hooks/HooksRunner.js#L41
We run some functions on the
hookandoptsargs before we do the args check, seems dangerous? Unless we are assuming that hook will always be defined, in whichcase theif (!hook)statement isn't necessary
Thu, 26 Nov 2020 10:08:43 GMT
@timbru says
I won’t make it today, crazy meeting marathon ahead. I’ll sum up my progress/evaluation of using GH Actions in paramedic and plugins and shoot a mail to dev@
Thu, 26 Nov 2020 10:14:05 GMT
@niklasmerz says
I could offer one topic. I did some work around WKWebView, proxy plugin etc.
Thu, 26 Nov 2020 16:07:53 GMT
@niklasmerz says
Shall we start? I could do Jitsi session?
Thu, 26 Nov 2020 16:09:40 GMT
@dpogue says
Sure, we can give Jitsi a shot
Thu, 26 Nov 2020 16:09:54 GMT
@niklasmerz says
https://meet.jit.si/cordova-hangout We can stream to Youtube as well
Thu, 26 Nov 2020 17:27:27 GMT
@dpogue says
@erisu https://developer.android.com/reference/androidx/webkit/package-summary
Thu, 26 Nov 2020 18:03:32 GMT
@erisu says
@dpogue @niklasmerz Lets add the actionable items here: https://github.com/orgs/apache/projects/2
We can later convert each card to an actual issue ticket for the repo it relates to.
Thu, 26 Nov 2020 19:55:37 GMT
@niklasmerz says
I added some cards with stuff I can remember.