Skip to content

getEndPoints() compatibility for strong-remoting - #241

Merged
davidcheung merged 1 commit into
masterfrom
getendpoints-compatibility
Oct 4, 2016
Merged

getEndPoints() compatibility for strong-remoting#241
davidcheung merged 1 commit into
masterfrom
getendpoints-compatibility

Conversation

@davidcheung

Copy link
Copy Markdown
Contributor

fixes /issues/236
in strong-remoting 2.x methods getHttpMethod() and getFullPath() were used
in strong-remoting 3.x we have deprecated those methods in favor of getEndPoints()
this patch is so users using newer SDK can still choose to use old strong-remoting
the change was introduced in /pull/229

@davidcheung davidcheung self-assigned this Sep 22, 2016

@bajtos bajtos left a comment

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.

The approach looks reasonable to me. Can we rename getEndpoints to something more descriptive, e.g. getPropertyOfFirstEndpoint?

@davidcheung davidcheung assigned bajtos and unassigned davidcheung Sep 27, 2016
@davidcheung

Copy link
Copy Markdown
Contributor Author

@bajtos PTAL

@bajtos bajtos left a comment

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.

Two minor comments to consider, no further review is necessary.

Comment thread lib/services.js Outdated
// this method is added to support both flavors of the getEndPoints method
// in strong-remoting 2.x methods `getHttpMethod()` and `getFullPath()` were used
// in strong-remoting 3.x we have deprecated those methods in favor of getEndPoints()
function getEndPointsBackwardsCompatility(remoteObj, item) {

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.

Can we rename this function too please?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment thread lib/services.js
return remoteObj.getHttpMethod();
} else if (item == 'fullPath') {
return remoteObj.getFullPath();
}

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.

What if item is neither verb nor fullPath? Should we throw an error instead of returning undefined?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

@bajtos bajtos added this to the #Epic: LoopBack 3.0 milestone Oct 4, 2016
@davidcheung
davidcheung force-pushed the getendpoints-compatibility branch from 27fc1f8 to 27c3953 Compare October 4, 2016 18:28
in strong-remoting 2.x methods `getHttpMethod()` and `getFullPath()`
were used in strong-remoting 3.x we have deprecated those methods
in favor of getEndPoints() this patch is so users using newer SDK
can still choose to use old strong-remoting the change was introduced
in /pull/229
@davidcheung
davidcheung force-pushed the getendpoints-compatibility branch from 27c3953 to 3d2d783 Compare October 4, 2016 18:30
@davidcheung
davidcheung merged commit b22c923 into master Oct 4, 2016
@davidcheung
davidcheung deleted the getendpoints-compatibility branch October 4, 2016 18:54
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.

Generate AngularSdk not working using this module

2 participants