oidc-client-js icon indicating copy to clipboard operation
oidc-client-js copied to clipboard

Use unminified sources as "main"

Open Alxandr opened this issue 5 years ago • 7 comments

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.

Alxandr avatar Feb 07 '19 07:02 Alxandr

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

loop-evgeny avatar Aug 30 '19 11:08 loop-evgeny

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.

sg3s avatar Oct 17 '19 11:10 sg3s

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:

  • main (code transpiled to CommonJS)
  • module (ejs code)>
  • browser (transpiled browser compatible code).

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 .

juanjoDiaz avatar Apr 15 '20 12:04 juanjoDiaz

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.

known-as-bmf avatar Jun 23 '20 09:06 known-as-bmf

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.

sethidden avatar Sep 25 '20 20:09 sethidden

ping @brockallen did you see my comment above?

juanjoDiaz avatar Sep 26 '20 07:09 juanjoDiaz

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

Lonli-Lokli avatar Dec 14 '20 13:12 Lonli-Lokli