vaimee / SEPA-js

A js client library for SPARQL Event Processing Architecture
https://site.unibo.it/wot/en
2 stars 2 forks source link

[WIP] Fix some problems #10

Closed iosonopersia closed 4 years ago

iosonopersia commented 4 years ago

Hi @relu91 . I'm trying to use NPM @arces-wot/sepa-js package inside my Angular 9 app. First problem is that some let and const were missing in function createURI (see util.js: 6), and so Angular was unable to compile this dependency. The other problem is that the Node.js https module is not available inside the browser context (as far as I was able to understand), leading to these error messages:

~~ERROR in ./node_modules/@arces-wot/sepa-js/lib/defaults.js Module not found: Error: Can't resolve 'https' in 'D:\iosonopersia\Documents\GitHub\ng-covid19\node_modules\@arces-wot\sepa-js\lib'~~

~~ERROR in ./node_modules/@arces-wot/sepa-js/lib/secure.js Module not found: Error: Can't resolve 'https' in 'D:\iosonopersia\Documents\GitHub\ng-covid19\node_modules\@arces-wot\sepa-js\lib'~~

I attached my temporary solution (commenting out every https reference), but obviously that may not be the right thing to do, since this way it may be impossible to use a secure connection. I don't know how to do better, maybe there are other https in-browser alternatives.

iosonopersia commented 4 years ago

⚠⚠⚠Please, don't merge this yet, other changes are coming.⚠⚠⚠

relu91 commented 4 years ago

Hi Simone, just a fast check. Have you tried to use the browser version of the library? is available here

iosonopersia commented 4 years ago

I removed the commit related to the https module. The browser version of the library works very well. Now it's ok to merge this Pull Request.

relu91 commented 4 years ago

Perfect, thanks! 👍