Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES6 export option for package @azure/msal-common #5443

Closed
stefaniehansen opened this issue Dec 2, 2022 · 6 comments
Closed

ES6 export option for package @azure/msal-common #5443

stefaniehansen opened this issue Dec 2, 2022 · 6 comments
Assignees
Labels
enhancement Enhancement to an existing feature or behavior. msal-browser Related to msal-browser package public-client Issues regarding PublicClientApplications

Comments

@stefaniehansen
Copy link

Core Library

MSAL.js v2 (@azure/msal-browser)

Wrapper Library

Not Applicable

Public or Confidential Client?

Public

Description

Related to #5274 #5274

Currently, @azure/msal-common does not ship an ESM build of the library. That means that tree-shaking is not possible for consumers of @azure/msal-common. With tree-shaking, we could significantly reduce the bundle size of consumer projects, including the OneNote Meeting Notes application. msal-common is currently one of the largest contributors to our bundle at around 121 KB parsed.

image

Given that the current recommendation for the size of an entry point bundle is 244KB according to webpack, this represents half of size of a typical app entry point. With both msal-browser and msal-common together, we've already taken up 249KB, more than the recommended entry point bundle size, even without any app code whatsoever.

image

This is a bulky library and adding ES6 exports make a very big difference to many apps that use it.

Source

Internal (Microsoft)

@stefaniehansen stefaniehansen added feature-unconfirmed question Customer is asking for a clarification, use case or information. labels Dec 2, 2022
@ghost ghost added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Dec 2, 2022
@github-actions github-actions bot added msal-browser Related to msal-browser package public-client Issues regarding PublicClientApplications labels Dec 2, 2022
@ghost ghost assigned bmahall Dec 2, 2022
@bmahall
Copy link
Contributor

bmahall commented Dec 5, 2022

Closing as duplicate of #5724

@bmahall bmahall closed this as completed Dec 5, 2022
@ghost ghost added answered Question has received "first qualified response" Needs: Author Feedback Awaiting response from issue author and removed Needs: Attention 👋 Awaiting response from the MSAL.js team labels Dec 5, 2022
@stefaniehansen
Copy link
Author

stefaniehansen commented Dec 8, 2022

@bmahall This isn't a dupe because this is concerning a different package (msal-common vs msal-browser).

@michaeloliverx
Copy link

Is this planned for the react bindings? Currently trying to reduce our bundle size and MSAL accounts for 60% of the entire bundle.
image

@sameerag
Copy link
Member

Yes, we have plans to, no decided deadline yet though. Will reopen this to track. cc @EmLauber

@sameerag sameerag reopened this Feb 10, 2023
@sameerag sameerag added the enhancement Enhancement to an existing feature or behavior. label Feb 10, 2023
@ghost ghost removed question Customer is asking for a clarification, use case or information. answered Question has received "first qualified response" Needs: Author Feedback Awaiting response from issue author feature-unconfirmed labels Feb 10, 2023
@tnorling
Copy link
Collaborator

tnorling commented Jul 6, 2023

A beta of the v3 version of msal-browser and beta of msal-react v2 are released which should be exporting ES2020 modules. Can you try that out and let us know if that resolves this issue? Thanks!

@tnorling
Copy link
Collaborator

Closing as msal-browser 3.0.0 and msal-common 14.0.0 are now released and include these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to an existing feature or behavior. msal-browser Related to msal-browser package public-client Issues regarding PublicClientApplications
Projects
None yet
Development

No branches or pull requests

5 participants