WebStorm vs Visual Studio Code

Having used both VS Code and WebStorm, here are my opinions of how they compare, mainly in regards to TypeScript and React development. This is a fast moving field, but I'll try to update this as I gather more information.

IDE vs Editor

WebStorm is categorised as an IDE (integrated development environment) and VS Code is more of an editor, although VS Code has has some features you might associate with an IDE.

Read More

webpack React - It looks like you are using a minified copy of the development build

Problem: It looks like you're using a minified copy of the development build of React.

So you may have found this message in your console log like I did. There is a link to the react downloads explaining that you need to set NODE_ENV to production so you get the production version of React. This doesn't have some of the code that is useful for debugging in the development version.

You may also be surprised by this as you have tried to set NODE_ENV to production and it is not working.

Read More

Cycle.js FAQ

Some Cycle.js FAQ notes I threw together and will try rearrange that might help people using Cycle.js. Some of these are notes copied from the Cycle.js Gitter channel.

Why does Cycle.js code often have $ symbols in variables

The $ convention is used to signify a variable that is an Observable.

Read More

TypeScript Duplicate Identifier and Typings

If your TypeScript tsconfig.json is using "exclude" and Typings for your TypeScript definitions, you may run into duplicate identifier warning messages.

error TS2300: Duplicate identifier

This warning means you are probably including multiply copies of the same file, or a file is redefining the same definitions.

Read More

npm linked modules with webpack

I was was having some problems with an npm module that was not updated on the "master" branch. It also had a lot of dependent child libs. There was a "develop" branch that I wanted to try. For some reason I had an issue with trying to use the "develop" branch from npm.

npm install user/project#branch

I probably should have open a Stack Overflow question about it, but maybe later.

Read More

StrongLoop Reddit Vote Manipulation

Wow, I found this Reddit thread the other day where StrongLoop seem to admit to vote manipulation on Reddit.

Vote manipulation. Suddenly, spam accounts everywhere submitting strongloop, commenting favorably just on strongloop posts, etc. Really obvious pattern. Proof is easily found by looking at the domain search for strongloop, and by submitting anything pointing to the domain. Immediate spam queue - the domain is reddit-shadowbanned.

reply by jakerella

Read More

Exception Handling - Promises vs Observables

A friend of mine was studying Promises in JavaScript. I mentioned how Promises swallow exceptions and continue execution by default.

I have recently been following RxJS and decided to knock up an example to find out how exceptions are handled differently in Promises versus Observables.

In the JS Bin below you will find the Promise swallows the exception thrown and we continue onto the Observable.

Read More

Babel transpile ignoring native Javascript

I was thinking today that we want Babel to ignore transpiling native JavaScript available in Node.js.

You could whitelist or blacklist what you want Babel to transpile and a few people list options in the comments here.

Babel 6 now does nothing by default, but there doesn't seem to be any Node.js version specific presets mentioned on the Babel page.

Read More

Are Google Dropping the Ball with Android

I've been using Android phones for a while now. Lately however, it has been a pot of boil and trouble. Lollipop issues, Kit Kat issues, Hangouts and Chrome issues spring to mind. It's time to try something else as outlined below.

Nexus 4 Problems

I have a Nexus 4 which was running great on Kit Kat. I made a fairly early move to Lollipop and was hit by early mover issues like many others. Okay, this is somewhat expected with a new release.

Read More