-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Expose mdc-ripple's util.js for ES5 #253
Comments
I also had that problem. Anyhow for now you can circumvent it by doing the following:
This will give you a default foundation that already uses |
Hey @Hardtack, We try to keep exposition of
I'm not sure I understand why users would also have to use a transpiler. If you're transpiling our source files as part of transpiling As @codesuki we made |
When I transpile my code to ES5 without webpack just with babel, it does not copy required module into output file. Like this: /* `some_library/index.js` */
import util from '@material/ripple/src/util';
... ⬇ /* `some_library/index.js` */
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var util = require('@material/ripple/src/util');
... And when user of some_library import this, without any transpiler, It will occur errors at var util = require('@material/ripple/src/util'); It means, imported module should always compatible with ES5 even if we are using transpilers. I can't understand why third party library depended on MDC-Web developers should have to bundle MDC-Web's code into their packages. Is there any plan to provide util modules like CommonJS way? |
@Hardtack fair point. I can see the value in exposing the ripple's We don't want to add too much to a public API right off the bat, only to change/remove something thus causing a breaking change. |
Work which needs to be done:
|
Resolves material-components#253: The docs recommend using certain functions from util when implementing an adapter for the ripple foundation. Export util from index.js so this is possible.
Resolves material-components#253: The docs recommend using certain functions from util when implementing an adapter for the ripple foundation. Export util from index.js so this is possible.
Resolves #253: The docs recommend using certain functions from util when implementing an adapter for the ripple foundation. Export util from index.js so this is possible.
I'm implementing custom MDCRippleFoundation adapter.
As you mentioned in document,
supportsCssVariables
function inutil.js
would be useful to implementbrowserSupportsCssVars() => boolean
.But,
@material/ripple/dist/mdc.ripple
does not exposes theutils
module. So I cannot use the module without transpiler configured for MDC.If i use transpiler to use that module, users of some_library also have to use same transpiler. But It does not seem to be good constraints.
The text was updated successfully, but these errors were encountered: