When using React-VR with Socket.io , I crash when importing socket.io-client - socket.io

I am trying to use React-VR with Socket.io. I am crashing when I try to import socket.io-client(v2.0.4). I have to browse through examples without coming up with a solution.

Putting your socket.io calls in componentDidMount as opposed to the constructor would be the correct way of doing this I beleive.

Related

How to make graphql work on ObservableHQ?

I am using observablehq for playing around with the graphql js library.
However, I fail at importing it and observable complains about this module.
Any hint? Do we need to modify the library to make it observable friendly?
Observable has a Module require debugger for these situations; given a module name, it can often find a way to make it work. E.g., for GraphQL, it suggests using Skypack, which works for me in a notebook:
graphql = import('https://cdn.skypack.dev/graphql#15.4.0')

How to use QUploader (Quasar-Framework) with websockets?

QUploader is documented here and here is its code.
I am trying to get QUploader (Quasar-framework version 0.14.7) working uploading images to a featherjs 'service' on external server, basically following along this example.
How do I use QUploader with websockets?
I tried to make feathersjs upload work without Quasar, that didn't work, but I am able to make Quasar work with a normal Express multer upload.
You just use add :upload-factory="uploadFile" to the q-uploader component.
The method goes like this: uploadFile(file, updateProgress)
And you can do whatever with the file what you want, and you can calculate the progress and call updateProgress(calculatedProgress) with calculatedProgress going from 0.0 to 1.0.
(Just make sure you have feathers-client wokring through websockets, then use Axios or something else on the client to upload it through websockets)
It's all explained here

Koa.js import x from 'y' not working

I'm using PM2 to server my Koa backend. However when I use imports it serves no website / crashes. What's the work around for this? I see Koa snippets with imports all over. Node v7.6 stable.
This isn't really a Koa-specific related issue. The ES6 import/export module syntax hasn't been implemented yet in browsers or node. For now, you can just use const x = require('y'). If you want to use the import/export syntax, you will need to use something like babel which converts your next-gen JS code into code that can run.

Use pouchdb promise polifil

I'm using pouchdb as a library in a tiddlywiky project. It provides a common js compatible environment, so I can just require it.
My project is targeted to several browsers so I can't expect promises to be available as default. Since pouchdb uses promises extensively I tough that it will be simpler to use promises in the rest of my code. I know that pouch includes a promise polifil, so here is my question :
Is that polifil available from outside? Can I use it? How?
Thanks and regards
Yes, you can use PouchDB's promise polyfill by using pouchdb-promise: https://www.npmjs.com/package/pouchdb-promise
If you are using npm, then it's just require('pouchdb-promise'). Otherwise, you can get it from wzrd.in: https://wzrd.in/standalone/pouchdb-promise

Parse Image + Parse httpRequest replacements — migrating from Parse Cloud Code to Parse Server on Node (Heroku / AWS / DO)

I found that when using the parse-node package, you can no longer use Parse.Cloud.httpRequest. I also know that Parse's Image object won't be available.
So far, I've been able to replace some Parse promises with native ones and use axios to make network requests.
However, I'm relatively new to Node, so I'm curious as to what are the most direct replacements for these, and how do I use them?
You should still be able to use Parse.Cloud.httpRequest. But axios is a great library and it's a great idea to start using it if you want to learn nodejs. When it comes to the parse-image it has to be replaced. There is a library which claims 100% compatibilty, check it out here.

Resources