hello.js icon indicating copy to clipboard operation
hello.js copied to clipboard

Better support for JavaScript Module Systems(CommonJS, AMD, ES2015 etc)

Open askamist opened this issue 7 years ago • 4 comments

as of now if we have to use this library with one of the module systems then we will have to include/load hello.all.js even if I want use only one or two of the social modules. It would be better if we can selectively include/load only the social modules we require.

askamist avatar Jul 03 '17 07:07 askamist

Please contribute to the next iteration https://github.com/MrSwitch/hello.js/pull/485:)

MrSwitch avatar Jul 03 '17 10:07 MrSwitch

Install the next version...

npm i hellojs@next --save

MrSwitch avatar Jul 05 '17 14:07 MrSwitch

Will we be / Are we able to import (webpack) just parts of hello, e.g. core,facebook,gmail ? It would reduce payload so much... I cannot find any docs for that.

murbanowicz avatar Jan 23 '18 08:01 murbanowicz

@murbanowicz you should be able to do that already,

// Core
const hello = require('hello/dist/hello.js`); // Set's global object

// Modules
require('hello/src/modules/google'); // uses global object, no need to pass through local hello

hello.init({
   google: [google_id]
});

// do something 
hello('google').getAuthResponse();


MrSwitch avatar Jan 24 '18 08:01 MrSwitch