sureshchahal / angular2-adal

Angular 2 wrapper for adal.js
MIT License
41 stars 50 forks source link

Please dont import the whole rxjs library #38

Closed ruimserrano closed 7 years ago

ruimserrano commented 7 years ago

Hi,

I notice that you import observer from rxjs in adal.service.ts and authHttp.service.ts

import {Observable} from 'rxjs';

but you should import like this

import { Observable } from 'rxjs/Observable';

so you dont import the whole library (+200kb)

thanks

ruimserrano commented 7 years ago

i've cloned, created a branch and changed the code. Tested on my project, was able to shrink my vendor bundle in 487kb less. Your lib is including all rxjs, but only needs mergeMap, catch,map and bindCallBack.

I dont have permissions to push my branch to issue a pull request. Do you want to see it and evaluate?

Cheers

sureshchahal commented 7 years ago

changing just to 'rxjs/Observable' throw error error TS2339: Property 'bindCallback' does not exist on type 'typeof Observable'.

is there some other change required to make it work? Also if you can submit pull request, I can check and publish

slubowsky commented 7 years ago

import 'rxjs/add/observable/bindCallback';

gert-janvercauteren commented 7 years ago

I believe #48 implements the changes you suggest

sureshchahal commented 7 years ago

fixed with #48