IdentityModel / oidc-client-js

OpenID Connect (OIDC) and OAuth2 protocol support for browser-based JavaScript applications
Apache License 2.0
2.43k stars 842 forks source link

Use unminified sources as "main" #753

Open Alxandr opened 5 years ago

Alxandr commented 5 years ago

Having minified sources be the "main" makes things much harder to debug. Minification should be an issue for the end client and how they want to setup webpack or similar, not the individual libraries.

loop-evgeny commented 5 years ago

Just ran into this when trying to troubleshoot #931. Isn't this a trivial change to make?

sg3s commented 5 years ago

One thing I noticed is that the minified and unminified sources seem to differ slightly in the objects/classes they expose. This was a bit hard to tackle while also trying to debug. Definitely should be changed for 2.0 due to that.

Making this change would allow packaging utilities to apply tree shaking to eliminate unused code in the library too.

juanjoDiaz commented 4 years ago

I agree that exposing the minified version is not good for integration and troubleshooting. However, the /lib/oidc-client.js is already transpiled and changed.

I think that the library should have:

Then most modern bundlers can automatically pick up the right one.

Since this issue and the related PR have been stuck for more than 6 months, I'd like to ask the maintainers if implementing a new build like this is something that you'd take as a PR or you want to keep things as they are, @brockallen .

known-as-bmf commented 4 years ago

Using the minified version as main renders the lib practically un-debuggable in a dev env.

As a workaround, you can manually edit node_modules/oidc-client/package.json, but you'll have to do it every time it is overwritten.

sethidden commented 4 years ago

Had to do what OP did today. This user did too: https://github.com/IdentityModel/oidc-client-js/issues/1044#issuecomment-591625560

This is quick to fix yourself when you know where to look, but otherwise it's another hurdle you need to jump over to debug your app.

juanjoDiaz commented 4 years ago

ping @brockallen did you see my comment above?

Lonli-Lokli commented 3 years ago

Honestly speaking, https://github.com/manfredsteyer/angular-oauth2-oidc is much-much better for Angular.