ConnectyCube / connectycube-js-sdk-releases

Releases materials for ConnectyCube JS SDK platform https://connectycube.com
9 stars 2 forks source link

NPM UMD package #2

Closed rubensolx closed 4 years ago

rubensolx commented 5 years ago

Hi, Do you plan release the JS (browser) version as a npm package (or adapt the current one to use UMD)?

This is very important for the ones that make use of bundlers and want to control the version of the lib (as the react-native and nodejs devs do currently)

Cheers,

DaveLomber commented 5 years ago

Hi @rubensolx

You can do that already, a minified version of SDK is available in npm registry

testcc

so you probably can require it in your app

Is it what you are looking for?

rubensolx commented 5 years ago

Hi Dave, What I checked is that the NodeJS SDK is available on NPM. I can't use it together with Webpack because within it is using a lot of internal Node libs. This same package can also be used for JavaScript? I mean, if I add as externals all the Node requires, It'll work on the browser?

Best,

ccvlad commented 5 years ago

Hi @rubensolx To build with the Webpack you can add externals: ['nativescript-xmpp-client', 'node-xmpp-client', 'node-fetch', 'form-data'] to the Webpack's config. But make sure you connect the connectycube SDK as require('connectycube'), it's important to that the entry point was from connectycube/src/cubeMain.js

rubensolx commented 5 years ago

Awesome :) Can you provide the source-map together with the minified file?

ccvlad commented 5 years ago

You don't need the source-map for previous tip, because the minified sdk won't use in your build. So, you able to use your own source-maps.

The ConnectyCube SDK has the source-map with minified file, but for build with Gulp+Browserify tools and nodejs libs (cdn.jsdelivr.net/npm/connectycube).

We have a Webpack build for the browser version, it will be released later after tests.

rubensolx commented 5 years ago

I mean, not on build but on development mode (my build will not be minified, so it will use the source-map from connecty-cube) That's pretty much the need for it :)

DaveLomber commented 4 years ago

As source-map file is provided now, so closing it