Skip to content

GH-706 dependency patch fix for 8.x only - #708

Merged
brody2consult merged 8 commits into
apache:8.1.xfrom
brody2consult:GH-706-xcode-hotfix
Sep 28, 2018
Merged

brody2consult merged 8 commits into
apache:8.1.xfrom
brody2consult:GH-706-xcode-hotfix

Conversation

@brody2consult

@brody2consult brody2consult commented Sep 28, 2018 •

Copy link
Copy Markdown

UPDATED:

  • reintroduce xcode dependency as needed in 8.1.x to avoid breaking plugins such as branch-cordova-sdk before next major release, to resolve xcode was removed, but is required with 8.1.0 #706 (bug xcode was removed, but is required with 8.1.0 #706)
  • emit a message in case someone uses requireCordovaModule('xcode') that it is now deprecated, will be removed in the near future, along with the recommended solution
  • reintroduce some other dependencies to better ensure that any other plugins or applications using requireCordovaModule would not be broken by a minor release upgrade
  • tar dependency back to tar@2
  • emit a deprecation warning message in case a plugin or application uses requireCordovaModule with a non-Cordova module
  • updates from PR Deprecate requireCordovaModule for non-Cordova modules #707:
    • minor optimization for requireCordovaModule for module names that do not start with "cordova-lib"
    • JSDoc updates
    • Context#requireCordovaModule unit tests

This fix is NOT WANTED in master branch. I think we do not want to support requireCordovaModule('xcode') in the next major release.

This fix was tested as follows:

  • pushed this change to bug-706-xcode-hotfix-test on my fork
  • made bug-706-xcode-hotfix-test branch on my fork of cordova-cli that uses cordova-lib from git+https://github.com/brodybits/cordova-lib.git#bug-706-xcode-hotfix-test as dependency
  • In https://github.com/brodybits/cordova-xcode-error (fork of https://github.com/Tallyb/cordova-xcode-error with config.xml fix):
    • I used cross-platform nvs tool (https://github.com/jasongin/nvs) to switch to Node.js 10.10 and do npm i -g https://github.com/brodybits/cordova-cli#bug-706-xcode-hotfix-test
    • cordova platform add ios outputs the deprecation message, does not fail with the xcode error

Resolves #706

@janpio

janpio commented Sep 28, 2018

Copy link
Copy Markdown
Member

(PR title should describe the change first, then administrative information)

@brody2consult brody2consult changed the title GH-706 xcode hotfix for 8.1.x only GH-706 xcode dependency hotfix for 8.1.x only Sep 28, 2018
@raphinesse

Copy link
Copy Markdown
Contributor

I think a minor release would be more fitting to introducing a deprecation notice, but I'm not quite sure. What would you say?

@raphinesse

raphinesse commented Sep 28, 2018 •

Copy link
Copy Markdown
Contributor

To really adhere to semver, we cannot drop any dependencies or make major version updates because of #689. So here's the list of dependencies that we dropped between 8.0.0 and 8.1.0:

dependency-ls@^1.1.1
request@2.79.0
unorm@1.4.1
valid-identifier@0.0.1
xcode@^1.0.0

Furthermore, we updated tar from 2.2.1 to ^4.4.1.

@brody2consult

Copy link
Copy Markdown
Author

I just pushed some changes:

Coming up are changes to restore the dependencies we dropped in 8.1.0.

@brody2consult
brody2consult force-pushed the GH-706-xcode-hotfix branch 2 times, most recently from e04f72e to a6206b9 Compare September 28, 2018 18:24
Comment thread src/hooks/Context.js Resolved
@raphinesse

Copy link
Copy Markdown
Contributor

@brodybits ping me when you think this is ready to review, please.

@janpio janpio changed the title GH-706 xcode dependency hotfix for 8.1.x only [WIP] GH-706 xcode dependency hotfix for 8.1.x only Sep 28, 2018
@brody2consult brody2consult changed the title [WIP] GH-706 xcode dependency hotfix for 8.1.x only [WIP] GH-706 xcode dependency patch fix for 8.1.x only Sep 28, 2018
@brody2consult
brody2consult removed the request for review from janpio September 28, 2018 19:14
@brody2consult brody2consult changed the title [WIP] GH-706 xcode dependency patch fix for 8.1.x only GH-706 xcode dependency patch fix for 8.1.x only Sep 28, 2018
@brody2consult

Copy link
Copy Markdown
Author

@raphinesse this PR is now ready for review.

Comment thread package.json
"cordova-js": "^4.2.2",
"cordova-serve": "^2.0.0",
"dep-graph": "1.1.0",
"dependency-ls": "^1.1.1",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this and all the other dependencies that are readded are not reflected in the PR title and description

@raphinesse raphinesse left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The only thing I'm still unsure about is whether this shouldn't rather be a semver minor change, because of the deprecation.

@brody2consult brody2consult changed the title GH-706 xcode dependency patch fix for 8.1.x only [WIP] GH-706 dependency patch fix for 8.1.x only Sep 28, 2018
@janpio

janpio commented Sep 28, 2018

Copy link
Copy Markdown
Member

It's just a deprecation notice, right? Then it should be acceptable to include it in a patch release.

@brody2consult brody2consult changed the title [WIP] GH-706 dependency patch fix for 8.1.x only GH-706 dependency patch fix for 8.1.x only Sep 28, 2018
@brody2consult

Copy link
Copy Markdown
Author

It's just a deprecation notice, right?

Yes. And I would like to resolve the GH-706 in a patch release.

One more thing is that if cordova-lib and Cordova CLI do not have the same version number there some extra "noise" will show up in cordova --version like this:

8.1.2-dev (cordova-lib@8.1.1-dev)

I would favor publishing this in cordova-lib@8.1.2 to avoid such noise.

@janpio

janpio commented Sep 28, 2018

Copy link
Copy Markdown
Member

I would favor publishing this in cordova-lib@8.1.2 to avoid such noise.

That's not how semver works.
That "noise" is expected and should be there (actually not showing the cordova-lib version if they are equal is not optimal).

Christopher J. Brody and others added 3 commits September 28, 2018 17:23
(without test for warning messages as proposed in apacheGH-707 for master)
(quick optimization)

Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
Co-authored-by: Christopher J. Brody <chris.brody@gmail.com>
raphinesse and others added 5 commits September 28, 2018 17:23
as needed to support Node.js 4
- dependency-ls@1
- unorm@1
- underscore@1
- valid-identifier@0.0.1

needed to adhere to semver principle

ref: apacheGH-706
needed to adhere to semver principles ref: apacheGH-706
@brody2consult

Copy link
Copy Markdown
Author

As discussed on the #dev channel on Slack, I just removed the changes to emit deprecation warning messages in case of non-Cordova modules (also removed a test case). This is to avoid the issue with https://semver.org/#spec-item-7 where a minor version increase is needed in case of the deprecation message. Merging now.

@brody2consult brody2consult changed the title GH-706 dependency patch fix for 8.1.x only GH-706 dependency patch fix for 8.x only Sep 28, 2018
@brody2consult
brody2consult merged commit 24e8545 into apache:8.1.x Sep 28, 2018
@brody2consult
brody2consult deleted the GH-706-xcode-hotfix branch September 28, 2018 21:29
@janpio

janpio commented Sep 28, 2018

Copy link
Copy Markdown
Member

You didn't actually remove the code before merging.

@brody2consult

Copy link
Copy Markdown
Author

What I removed was cherry-pick of 27a2cfd from PR #707. You should not see any trace of it since I did a rebase with the cherry-pick of 27a2cfd. If I look at https://github.com/apache/cordova-lib/pull/708/files the code to emit the deprecation warning is no longer there.

@janpio

janpio commented Sep 28, 2018 •

Copy link
Copy Markdown
Member

Why is the rest of #707 required?
(Don't forget to update the PR description to reflect what you actually merged)

@raphinesse

raphinesse commented Sep 28, 2018 •

Copy link
Copy Markdown
Contributor

It does fix a theoretical bug but it's definitely not required.

For the record: I'd still prefer to have all the changes I originally approved together in a minor release.

@brody2consult

Copy link
Copy Markdown
Author

(Don't forget to update the PR description to reflect what you actually merged)

Done

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

Successfully merging this pull request may close these issues.

3 participants