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

UMD of polished is not valid on the browser side #568

Open
jmfrancois opened this issue Feb 17, 2021 · 1 comment
Open

UMD of polished is not valid on the browser side #568

jmfrancois opened this issue Feb 17, 2021 · 1 comment

Comments

@jmfrancois
Copy link

  • polished version: 3.6.0

What You Are Seeing

I see global variable for package that do not exists in UMD.
It exists since 3.6.0 version. 3.5.2 is working well:

You can just look at the signature on the first 4 lines

(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@babel/runtime/helpers/esm/extends'), require('@babel/runtime/helpers/esm/assertThisInitialized'), require('@babel/runtime/helpers/esm/inheritsLoose'), require('@babel/runtime/helpers/esm/wrapNativeSuper'), require('@babel/runtime/helpers/esm/taggedTemplateLiteralLoose')) :
  typeof define === 'function' && define.amd ? define(['exports', '@babel/runtime/helpers/esm/extends', '@babel/runtime/helpers/esm/assertThisInitialized', '@babel/runtime/helpers/esm/inheritsLoose', '@babel/runtime/helpers/esm/wrapNativeSuper', '@babel/runtime/helpers/esm/taggedTemplateLiteralLoose'], factory) :
  (global = global || self, factory(global.polished = {}, global.extends, global.assertThisInitialized, global.inheritsLoose, global.wrapNativeSuper, global.taggedTemplateLiteralLoose));
}(this, (function (exports, _extends, _assertThisInitialized, _inheritsLoose, _wrapNativeSuper, _taggedTemplateLiteralLoose) { 'use strict';

This seems to have been introduced by #7886d942b03ba452be4926a8d566ff67c4ac4161

What You Expected To See

I exepct to see only umd dependencies that exists in UMD.

(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
  (global = global || self, factory(global.polished = {}));
}(this, (function (exports) { 'use strict';

And a chapter on the README explaining how to setup a script tag to use this umd build it in the browser.

@ctrlplusb
Copy link

ctrlplusb commented Feb 23, 2021

The latest version (4.1.1) tries to require babel-runtime helpers too. Would be awesome if those were just inlined within the UMD build. 🙏

https://unpkg.com/browse/polished@4.1.1/dist/polished.js

It appears that 3.6.0 has the same issue.

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