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

Optimize client-side @commercetools/sdk-auth #1653

Closed
studentIvan opened this issue Jan 26, 2021 · 1 comment
Closed

Optimize client-side @commercetools/sdk-auth #1653

studentIvan opened this issue Jan 26, 2021 · 1 comment
Assignees

Comments

@studentIvan
Copy link
Contributor

Description

A lot of useless code coming with this library:

  1. Buffer polyfill
  2. Lodash (defaultsDeep)

Expected Behavior

It works without these libraries or load them only on demand.

Current Behavior

It works with these libraries and is impossible even to replace them if you use just simple import SdkAuth, { TokenProvider } from '@commercetools/sdk-auth'; because it uses the UMD version.

Possible Solution

#1649
#1650
#1651

@tayzlor
Copy link

tayzlor commented May 13, 2021

+1 This prevents this library from being used with build tools such as Vite - which inherently don't support node polyfills in the browser - which subseqeuntly spits out ReferenceError: Buffer is not defined for any node related modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants