firebase.js (Firebase js API) not recognized in Webstorm - javascript

I am using (testing) Webstorm 7 EAP for development. I downloaded the
https://cdn.firebase.com/v0/firebase.js
to be able to have code completion and JSDocs for Firebase.
To my disappointment not only do I not jet the JSDocs (the firebase.js appears to be minified), but webstorm can't even see the Firebase API at all.
When I type:
var fbase = new Firebase(...)
Webstorms warns "Unresolved type Firebase".
How can I get Webstotm to play with Firebase nicely?
I get a feeling that my problem is due to firebase.js being minified.
Is there somewhere a version of firebase.js that is not minified and with JSDocs? Would help a lot.
BTW Oddly enough, Webstorm 7 can see angularFire.js just fine.
regards
Jared

You can use the unminified version of Firebase for development. Also, if WS is still fussy you can try a couple different things.
Find the reference to Firebase in your code and click on it, click the light bulb, choose download library:
Add Firebase-debug to your JS Libs under Project Settings -> JavaScript -> Libraries. You'll have to download the -debug version first, then make sure you've checked it for inclusion in the project:

Related

node-ssdp API for Sonos is missing

I'm trying to figure out how to interact with the Sonos One using JavaScript; Sonos has developer guides and downloads for JavaScript but none of them work, because the node-ssdp project has been archived and is no longer available. Does anyone have a reference or a contact at Sonos through which we can access the devices directly? The cloud API works but is a lot heavier than talking to the devices directly over a LAN.
Okay, this ended up being a dumb question. Sonos apparently forked node-ssdp and hosted their own for a while, and the standard npm node-ssdp library works fine for this purpose.
Remove the node-ssdp dependency from the package.json, then:
npm i node-ssdp
Not everything works, because the Sonos samples in JS were written for very old versions of Node and have not been updated, but the base packages are fine.

Visual Studio Code - compile Javascript on save

The tutor of my video tutorial compiles javascript/react on save with his VS Code editor. Mine dont.
How can I config VS Code to do this?
Remark:
I find solution for typescript "Visual Studio Code - compile on save", but suggested solution does not work for me.
#added information:
the project is created with create.react-app. npm start opens chrome, and compilation errors are then shown in Chrome's DEV-Console, as noted by Shishani . My tutor has the code compiled on VS Code Terminal console. This offers a quick check of the code compilation before I go to webbrowser, to check for errors there, which seems to me much more intimidating with it's long callstacks.
If you create your React project with create-react-app, and then start it with npm start, it compiles automatically on save. Also, if it's not a React project, but just JS/HTML/CSS, you can open your project with the "Live Server" extension in VSCode, and it will update your page every time you save a file in your VSCode workspace.
You can even do like I do, and enable constant autosave, with the AutoSave: afterDelay setting in VSCode (if you dare), and then set the save delay to a super small number (mine is 2ms) so you don't even need to hit save anymore (go to File>Preferences>Settings>[Search "Auto Save"]).
If you have created react project using there official cli tool (create-react-app) then on saving js files it gets re-compile. This is because they are using webpack bundler behind the scene.
If you have created normal html or js files without any such cli tools then it won't work directly, You have to use some kind of bundler with dev-server support to do it.
Parcel! is a great bundler to use without configuration

Siddhi javascript error could not initialize class io.siddhi.extension.script.js.EvalJavaScript

When I try to use a javascript function I get this error: "could not initialize class io.siddhi.extension.script.js.EvalJavaScript"
I see in the lib folder that the siddhi-script-js-5.0.3.jar is there, both in the runner and the tooling, do I need to install any more extension?
I think there is a BUG in Siddhi with the javascrpt plugin.
I add the Siddhi official example and there is an error, you can notice in the third image.
I guess this is an official bug from Siddhi-Docker, as the base JDK image used for the dockerization is a slim version, which doesn't have the NashornScript libraries for JS compilation.
The siddhi-runner works on using a non-slim version of base JDK image. I have verified it locally and it works well. My pull request is pending for review.
https://github.com/siddhi-io/docker-siddhi/pull/33

TypeScript finds imports, but Chrome+JavaScript doesn't

I’m trying to use a TypeScript library (zxing-typescript in particular).
My typescript file begins with:
import * as ZXing from '../../lib/#zxing/library'
// Also happens when importing from '../../lib/#zxing/library/esm' and '../../lib/#zxing/library/esm/index'
The resulting JavaScript file contains the import verbatim. In all cases, TypeScript is correctly finding ../../lib/#zxing/library/esm/index.d.ts and giving me proper completion and compile errors, but running the resulting JavaScript from the latest Chrome Version 80.0.3987.132 (Official Build) (64-bit), I get a 404 looking for a file named library.
Things get a little better if I begin the TypeScript file with:
import * as ZXing from '../../lib/#zxing/library/esm/index.js'
but index.js contains lines such as
export * from './browser/BrowserBarcodeReader';
referring to ./browser/BrowserBarcodeReader.js. Again, if I go into the library and edit index.js to include the extension, the situation continues to improve, but many of the dependencies have dependencies of their own and I get similar issues.
How were index.js and index.d.ts meant to be used?
(Hopefully this question isn’t a duplicate of Does ES6 import/export need ".js" extension?, as I can’t imagine plan A is to change the server settings to check for JS files).
EDIT: The library "#zxing/library#0.15.2" is getting pulled from jsdelivr (one of the package managers suggested by Visual Studio 2019's libman), but I tried looking into some other forms of the zxing library.
The one suggested by this link gave C++ errors when installing dependencies (npm install) and TypeScript errors when compiling (tsc) related to some of the #types (I recognized Chai and was surprised such a big name library was giving errors).
Were successfully using zxing with straight JavaScript by including UMD/index.min.js, the name suggesting the UMD module works fine. There's no typescript definitions in the UMD directory, but maybe there's a way to have TypeScript figure some of the module information out from that JavaScript file.
I'm new to a lot of this, so user error isn't out of the question.
Any further guidance would be appreciated, but I mainly wanted to thank everyone for their help and let you know I did try your suggestions.

Problem using jQueryWTP 0.36 for Eclipse

I am trying to get jQueryWTP to work with Elipse 3.5.2. I followed the instructions and the new jar file was created (org.eclipse.wst.jsdt.core_1.0.201.v2010012803.jar). I replaced this new jar file with the old jar file in the Eclipse plugin directory. However, when I started Eclipse I saw an error with this jar file.
Here is the error I am seeing in the Eclipse log file:
Either the manifest file or the signature file has been tampered in this jar: C:\Program Files\Eclipse\eclipse 3.5.2\plugins\org.eclipse.wst.jsdt.core_1.0.201.v2010012803.jar
Has anyone else received this type of error when installing jQueryWTP? And, if so did you find a workaround to get this to work?
I have spent much time researching this and have not come up with a solution. I did see that someone else had this problem, but there wasn't a solution provided.
Trish
If you can/want you may be interested in trying out Aptana Studio (http://www.aptana.com/)... It has great support for a lot of js frameworks and intellisense.
HTH
Cheers!

Categories

Resources