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

Breaking changes in hooks/Context #709

Merged
merged 4 commits into from
Mar 12, 2019

Conversation

raphinesse
Copy link
Contributor

This includes a few changes to hooks/Context that necessitate a major release:

@codecov-io
Copy link

codecov-io commented Sep 29, 2018

Codecov Report

Merging #709 into master will decrease coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/hooks/Context.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 81439dc...198c2a2. Read the comment docs.

Copy link
Member

@erisu erisu left a 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.

@erisu erisu merged commit 929a6ed into apache:master Mar 12, 2019
@raphinesse
Copy link
Contributor Author

raphinesse commented Mar 12, 2019

Thanks for merging!

@raphinesse raphinesse deleted the next-gen-requireCordovaModule branch March 12, 2019 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants