Skip to content

Conversation

@muthurathinam
Copy link
Contributor

@muthurathinam muthurathinam commented May 29, 2019

New Features (Breaking Changes)

We are excited to announce that we will be releasing the preview for version 2.0.0 which will have the following changes

Polyfilling

Removed polyfills for Fetch and Promise, Now its the responsibility of the library users to polyfill these based on their environment support needs.

New minified files

graph-js-sdk-web.js and graph-js-sdk-core.js files are no longer available, new file named graph-js-sdk.js will be shipped along with graph-es-sdk.js. Both graph-js-sdk.js and graph-es-sdk.js will not depend on the isomorphic-fetch and es6-promise anymore.

Getting Raw Response

When making request using callback method raw response will not be passed as the param to the callback, instead one can get the same by using .responseType(ResponseType.RAW).

Renaming MSALAuthenticationProvider

Authentication provider and its options for MSAL library are now renamed from MSALAuthenticationProvider to ImplicitMSALAuthenticationProvider.

Initializing ImplicitMSALAuthenticationProvider

In order to create an instance of ImplicitMSALAuthenticationProvider previously named as MSALAuthenticaitonProvider. Now you can only pass an instance of MSAL's UserAgentApplication and MSALAuthenticationProviderOptions

Creating MSAL's UserAgentApplication

MSAL changed its way of initializing UserAgentApplication (also called as MSALInstance) in v1.0.0. Since we updated our MSAL's dependency to latest stable version and ImplicitMSALAuthenticationProvider modified to adapt the same. Creating instance of ImplicitMSALAuthenticationProvider takes UserAgentApplication created as per MSAL v1.0.0

Test plan

  • npm run test to test newly added tests.
  • Fire up the browser sample to test the new initialization method

Closing issues

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

muthurathinam-m and others added 20 commits May 7, 2019 11:38
* Removed polyfill dependencies for fetch and promise
* Removed Browserify and replaced it with rollup
* Modified params passed in for initializaiton of MSAL provider - Breaking change
* Fixed @nextlink property in Batching
* Added negative value check for default values in retry and redirect handlers
* Fixed - Auth handler replaces the authorization header
* Fixed - Telemetry handler replaces the sdkVersion header
…ons to ImplicitMSALAuthenticationProvider and ImplicitMSALAuthenticationProviderOptions
@mlynam
Copy link

mlynam commented Jun 18, 2019

Any ETA on the changes in this review? We're in an awkward place with this lib until this merges because of the old MSAL reference.

@bitflower
Copy link

Absolutely agree, spent some hours debugging mismatches today.

Is there a dev release on npm to help test?

@muthurathinam
Copy link
Contributor Author

@bitflower we haven't released in npm yet. will let you know once preview is released.

@NoPhaseNoKill
Copy link

Having the exact same issue as @bitflower as noted in this: #193 and am really needing this fix to be published. Do we have an ETA?

darrelmiller
darrelmiller previously approved these changes Jun 19, 2019
@muthurathinam
Copy link
Contributor Author

@bitflower @mlynam @NoPhaseNoKill we have planned a preview release for v2.0.0 today. will update you once its released.

@NoPhaseNoKill
Copy link

Thanks for the help guys. Appreciate the release when it does go out :)

@bitflower
Copy link

That's great to hear, thanks!

@NakulSabharwal NakulSabharwal self-requested a review June 19, 2019 08:57
@muthurathinam muthurathinam merged commit f813590 into dev Jun 19, 2019
@muthurathinam muthurathinam deleted the v2.0.0 branch June 19, 2019 09:18
@muthurathinam
Copy link
Contributor Author

@bitflower @mlynam @NoPhaseNoKill
Preview for 2.0.0 is released, try it out and let me know your feedback.
To install the preview version of the library, use npm install @microsoft/microsoft-graph-client@Preview.

Refer this release notes for the list of changes.

@bitflower
Copy link

Worked for my simple use case!

Having a little trouble with my typescript imports though. Only got it to work like this:

import { AuthenticationProvider } from '@microsoft/microsoft-graph-client';
import * as MSALAuthenticationProvider from '@microsoft/microsoft-graph-client/lib/es/browser/ImplicitMSALAuthenticationProvider';

export let authProvider: AuthenticationProvider;

export const getAuthProvider = (userAgentApplication, scopes) => {
  console.log('getAuthProvider');
  authProvider = new MSALAuthenticationProvider.ImplicitMSALAuthenticationProvider(
    userAgentApplication,
    {
      scopes
    }
  );
};

Repo: https://github.com/bitflower/stencil-ms-graph
Code: https://github.com/bitflower/stencil-ms-graph/blob/master/src/graph/auth-provider.ts

@mlynam
Copy link

mlynam commented Jun 19, 2019

@bitflower I used the following import import { ImplicitMSALAuthenticationProvider } from '@microsoft/microsoft-graph-client/lib/src/ImplicitMSALAuthenticationProvider';

This is the method they suggest in the docs as well.

@mlynam
Copy link

mlynam commented Jun 19, 2019

@muthurathinam this is working for me now. I've only attempted to access the /me api so far, however.

@bitflower
Copy link

Thanks @mlynam your imports worked!

@NoPhaseNoKill
Copy link

This has resolved the scopes issue for me. Thanks guys, will let you know if any other issues!

@muthurathinam
Copy link
Contributor Author

Worked for my simple use case!

Having a little trouble with my typescript imports though. Only got it to work like this:

import { AuthenticationProvider } from '@microsoft/microsoft-graph-client';
import * as MSALAuthenticationProvider from '@microsoft/microsoft-graph-client/lib/es/browser/ImplicitMSALAuthenticationProvider';

export let authProvider: AuthenticationProvider;

export const getAuthProvider = (userAgentApplication, scopes) => {
  console.log('getAuthProvider');
  authProvider = new MSALAuthenticationProvider.ImplicitMSALAuthenticationProvider(
    userAgentApplication,
    {
      scopes
    }
  );
};

Repo: https://github.com/bitflower/stencil-ms-graph
Code: https://github.com/bitflower/stencil-ms-graph/blob/master/src/graph/auth-provider.ts

Yes @bitflower this is the feasible way as of now.

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.

9 participants