How to install devDependencies in NODE_ENV=production?

Recently, I’ve faced with interesting research task at work related to AzureDevOps as a CI platform and NodeJS/npm as targeted resource. Our pipeline yaml file was configured to run npm command with deprecated flag – npm ci --dev and as turned out for npm@<7 it’s suggested to use --also=dev and for npm@>7 is suggested to use --include=dev. But when I tried different variants, to be sure if it works at all or not I saw no difference.

I always knew that npm ci designed to run specifically on CI (at least due to the fact that node_modules is being deleted and package-lock.json file recreated). But I didn’t know how environmental variable NODE_ENV value (either not set, development or production) actually influences work of npm. Reading npm documentation, Stackoverflow questions and answers it’s not always clear how it works. Yes, I know, that npm ci under the hood is actually npm install (alias npm i), but still both commands give us different behavior.

By default I always use npm ci (as it’s suggested to run on CI) on my CI instances (Jenkins, CircleCI, Heroku) so it always installed devDependencies for me and I never intended to include or omit. Work use case got me thinking more, so I decided to research very detailed.

Continue reading “How to install devDependencies in NODE_ENV=production?”

Why GraphQL Does Win? [case study with GitHub API]

This all started from personal wish to try GraphQL, to see how it works, to code something, and then make a decision, based on own experience. I also tend to grasp new technologies, as fast as I can, and that is why this project dedicated to new things, at least some first touch.

TL;DR

GitHub API, REST vs. GraphQL, XmlHttpRequest vs. Fetch API, HTML5 template, ES6 String Literals, ES2017 import/export, ES2017 async/await, URLSearchParams API, Chrome Canary, NodeJS, npm vs. bower, Bootstrap v4.0.0-beta, v4-dev,  Pace progress bar, OAuth vs. Auth0, deployment to Heroku.

I was working on set of work-related tasks and personal sandbox projects, and I came up with task idea:

Get list of GitHub repositories based on my custom data about owner and name.

Later on, my idea reminded me existed web site created by Michael RambeauBestOf.Js.Org (great resource, check it out).

But here, I will share my experience about working directly with GitHub API, with their version 3 (REST-based) and version 4 (GraphQL-based).

Continue reading “Why GraphQL Does Win? [case study with GitHub API]”

How I fixed my broken github notifications

UPD: 😦 It’s not fixed/resolved. I created a new comment to one of issues, received email, then accidentally clicked “Mute” and went to the page.A bit later, checked Notifications page – again the same. But then re-subscribed/watched. Did not help right away.A bit later, refreshed the page – Notifications alive. No idea what is happening.

===

It’s been a while, since I started seeing warning about errors on Notifications page on GitHub. I was more than sure, it’s due to my huge list of watched repositories. As fallback page on GitHub says, I tweeted to support, but none answered.

Continue reading “How I fixed my broken github notifications”

That is why _.find() and _.findWhere() are different

During my work on web project for US client, I faced with interesting issue, which at the first look seemed to be related to D3.js/C3.js donut charts, but after deep debugging, I discovered it’s because of nature of Underscore.JS 1.6.0 library/code. I would say, it’s bright example of the fact how important to know main purpose of dedicated API/tool, and implement custom codebase for the future to be working also correct.

Continue reading “That is why _.find() and _.findWhere() are different”

Can Backbone.JS use Lodash.JS instead of Underscore.JS ?

The fact is – Lodash.JS is nice competitor for Underscore.JS. There are so many thoughts in a community regarding how different and how good they are. This post is about Backbone.JS and required dependency of Underscore and my willingness to BE SURE, that replacement/migration is OK. So I asked myself:

How good Lodash is against Underscore in scope of Backbone.JS stable/correct work?

1 2

And as turned out, I found more than answers, I found “future”. 🙂

Continue reading “Can Backbone.JS use Lodash.JS instead of Underscore.JS ?”