-
Notifications
You must be signed in to change notification settings - Fork 90
Runs on the browser? #82
Comments
Follow is out of scope |
Maybe find a way to build it via webpack? Right now it seems to break because of this line in nano. |
The master branch of nodejs-cloudant now depends on 6.1.5 of Nano which should support webpack. |
I'm not familiar with webpack but I had a go. I created a
and ran
As this library depends on Nano, which depends on Request which depends on "fs", I think that's me stumped! |
Work in progress is in the 'webpack' branch |
Hey Glynn If you add the following to your webpack config, webpack with mock these node modules, and you should be able to compile without any errors.
However, it throws up the following error when you try to use it
It seems to be related to request/request#1619, but I too am lost on how to make it work. |
Got it to work - with a hack, but still.. Just do this before requiring this library.
Should be able to run without this hack after mike-spainhower/querystring#4 is closed. |
? |
Yeah that works, was just being lazy. |
@abhishiv would you mind publishing your HTML showing how you are requiring this bundle, including the Querystring work-around? |
Hey Glynn What exactly do you want to check? I am actually planning to use this module in a project, however that isn't public as of yet. However I have pushed abhishiv/nodejs-cloudant@5dc4f0c8d78f6b5955f5ee45542281789803bcc0 which contains a complete webpack config and a webpack script. If you run node ./webpack.js in that branch, you'll have the bundle at http://localhost:3500/static/bundle.js. I'm not actually sure where the qs fix should go. Since my project uses request as well, I just patch it before requiring nodejs-cloudant. But in this case I think it should go into nano - because nano is the one which actually requires request. |
I'm just looking for some sample HTML that includes the bundle, patches it and makes it all work ;) |
Ah understood, I just pushed an example at abhishiv/cloudant-node-webpack-consumer. You just need to set a password in src/index.js and add your domain to the CORS section in your cloudant dashboard. |
Closing, we're not planning to do this. If further browser support requirements materialize we should address them in cloudant-node-sdk. |
No build, no distribution, just get the code working from a browser as an alpha release.
The text was updated successfully, but these errors were encountered: