Update sdk to use loopback 3.x - #253
Conversation
| // this is to handle strong-remoting does not prepend prototype. | ||
| // back into prototype methods | ||
| if (action.sharedMethod.isStatic === false) { | ||
| aliasMethod = ['prototype', aliasMethod].join('$'); |
There was a problem hiding this comment.
I think aliases of prototype methods should be handled by strong-remoting. I thought we have already discussed this, was there a good reason why to keep the above workaround?
There was a problem hiding this comment.
@bajtos previous convo conclusion is to just prepend prototype to avoid a breaking change in strong-remoting
bajtos: well, we can introduce a method to get a list of all methods & aliases
but e.g. the rest adapter does not want to de-duplicate aliases
david: right, ill take a look and fix this problem with patchAttributes, then maybe add an issue to see if we should explore " introduce a method to get a list of all methods & aliases"
bajtos: hmm, I just realised my proposal would be a breaking change in strong-remoting
because code expecting to see aliases withoutprototype.prefix will break after the change
so maybe it will be best to fix the problem in Angular SDK only for short-termuce a method to get a list of all methods & aliases" for longer term
There was a problem hiding this comment.
Could you please create an issue to keep track of the long-term solution?
| var options = models[m].options || {}; | ||
| if (initialModels[m]) { | ||
| model = initialModels[m]; | ||
| lbApp.model(model, extend({ dataSource: 'db' }, options)); |
There was a problem hiding this comment.
If I am reading this code correctly, then you are calling lbApp.model twice for any custom model that happens to be in initialModels too.
I think a better solution is to merge initialModels to models so that you can iterate only over models here.
| loopback.autoAttach(); | ||
|
|
||
| if (enableAuth) | ||
| lbApp.enableAuth(); |
There was a problem hiding this comment.
Use lbApp.enableAuth({ dataSource: 'db' }), it will auto attach any required models that are not attached yet.
There was a problem hiding this comment.
That may be actually the only change needed to fix removed autoAttach call.
|
@slnode test please |
|
looks like cis-jenkins picks up the dependency same as npm info loopback@^3.0.0 --registry=http://apiconnect01.rchland.ibm.com:4873/ .version .gitHead
.version = '3.0.0'
.gitHead = '8d0f319dd616a047793f8e8bc02f0649a97afdff' |
|
@slnode test please |
bajtos
left a comment
There was a problem hiding this comment.
Code changes LGTM, now we need to figure out why cis-jenkins is failing...
I have released loopback@3.1.0 this morning, and restarted the build few moments ago. Let's see if it's still failing. |
|
@slnode test please |
blocked by strongloop/loopback#2928