-
Notifications
You must be signed in to change notification settings - Fork 244
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
Breaking changes in hooks/Context #709
Breaking changes in hooks/Context #709
Conversation
Codecov Report
@@ Coverage Diff @@
## master #709 +/- ##
==========================================
- Coverage 83.35% 83.29% -0.07%
==========================================
Files 50 50
Lines 2763 2753 -10
==========================================
- Hits 2303 2293 -10
Misses 460 460
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I tested first the old use case with the following example from Cordova doc (Cordova Docs: Hooks)[https://cordova.apache.org/docs/en/8.x/guide/appdev/hooks/index.html#javascript].
module.exports = function(context) {
var Q = context.requireCordovaModule('q');
var deferral = new Q.defer();
setTimeout(function(){
console.log('hook.js>> end');
deferral.resolve();
}, 1000);
return deferral.promise;
}
$ cordova prepare
Warning: using prerelease version 8.0.1-nightly.2019.3.12.5cfbb4d3 (cordova-lib@9.0.0-nightly.2019.3.12.d4df8a93)
Using "requireCordovaModule" to load non-cordova module "q" is deprecated. Instead, add this module to your dependencies and use regular "require" to load it.
hook.js>> end
Then I updated cordova-lib
llocally with the following PR code changes and re-ran the command.
cordova prepare
Warning: using prerelease version 8.0.1-nightly.2019.3.12.5cfbb4d3 (cordova-lib@9.0.0-nightly.2019.3.12.d4df8a93)
Using "requireCordovaModule" to load non-cordova module "q" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
Additional test includes adding q
module as a project dependency, update hook script by changing var Q = context.requireCordovaModule('q');
to var Q = require('q');
and re-run.
Thanks for merging! |
This includes a few changes to
hooks/Context
that necessitate a major release:requireCordovaModule
to Cordova modules #689)Context.cordova
to avoid cyclical dependencyconst
for imports