mean-expert-official / loopback-sdk-builder

Tool for auto-generating Software Development Kits (SDKs) for LoopBack
Other
399 stars 175 forks source link

Generated sdk for angular is not working in angular 5 #529

Closed dmastag closed 6 years ago

dmastag commented 6 years ago

What type of issue are you creating?

What version of this module are you using?

Write other if any:

Please add a description for your issue:

I tried to upgrade my existing angular-cli project to Angular 5 and got a bunch of errors on production builds. I think this has to do with the way rxjs is imported but I am not sure.

jonathan-casarrubias commented 6 years ago

Have you tried to update the SDK? yesterday I got a PR related to NG5 and is published now. Try that and see if works!

dmastag commented 6 years ago

Yes, I did. Also saw that the Observables are still imported from 'rxjs/Rx' Though even after updating them all manually, it was still preventing me from production builds.

dmastag commented 6 years ago

I tried on a brand new angular5 generated with angular-cli and import the sdk which was failing. Then I tried to do some manual changes, which are:

replace all import { Observable } from 'rxjs/Rx'; with import { Observable } from 'rxjs/Observable';

And add into sdk/models/FireLoopRef.ts the following import 'rxjs/add/operator/merge';

And into sdk/sockets/socket.connections.ts and /sdk/services/core/real.time.ts the following import 'rxjs/add/operator/share';

It was working on the angular-cli project afterwards to do production builds ng build --prod

mrnetforge commented 6 years ago

When we can except new release with fix?

jonathan-casarrubias commented 6 years ago

@dmastag thanks for sending the patch, I just landed this in version 2.1.1, please check if everything goes well, also...

The test environment is already using Angular 5, so everything should go fine..

Cheers Jon

dmastag commented 6 years ago

@jonathan-casarrubias thanks for the merge. Just tested 2.1.1 and its working as intended, am going to close this now.