TIL: Objects in Nim

Objects in Nim use the type constructor:

Type Definition type MusicTrack = object index: int title: string # (Mutable) Value var summer = MusicTrack(index: 1, title: "Summer in the City") That reminds me of Records in Reason:

/* Type definition */ type musicTrack = {index: int, title: string} /* Value */ let summerInTheCity = {index: 1, title: "Summer in the City"} In Nim, “An object is a value type, which means that when an object is assigned to a new variable all its components are copied as well.

Read more →

Learning About Nodejs Graphql Microservices

I'm currently working on a few micro-services with Docker. The architecture looks promising to me, and I like to play with Docker containers. Lately I've been watching a few videos about Node.js/GraphQL Microservices by Better Coding Academy. The tutorial series assumes a lot of knowledge (JavaScript, Express, GraphQL, Docker). I would have liked more detailed explanations. But the videos are still useful for showing the architecture of an Express/GraphQL setup with micro-services.
Read more →

babel-eslint and prettier-eslint-cli Are Broken

A while ago I figured out how to format and prettify all JavaScript files in a project. The guide worked for me at the time of writing. Unfortunately, the current versions of babel-eslint and prettier-eslint-cli are both broken. Relative paths are broken with prettier-eslint-cli and eslint 6.7.0 prettier-eslint [ERROR]: There was trouble creating the ESLint CLIEngine. There is a workaround for Linux and MacOS: inject $(pwd) before the file path.
Read more →

Friday Picks 030

Read more →

State of Js Survey 2019

Read more →

Friday Picks 029

Read more →

Fix Import React Renderer With Jest Error

A few days ago, I updated a React application that uses Jest and Enzyme for testing. The new tests yielded errors like cannot find module ‘react-test-renderer’. Solution: Install react-test-renderer and enzyme-to-json as dev dependencies, and re-factor tests to use enzyme-to-json. npm i –save-dev react-test-renderer enzyme-to-json In your package.json file, add the serializer to your jest config: { "jest": { "snapshotSerializers": [ "enzyme-to-json/serializer" ] } } Example test file before update:
Read more →

Learning About Best Practices for Docker and Node

Today I've tried to update one of my Docker apps that uses React, Enzyme, and Jest. This lead me on a wild goose chase about react-test-renderer and best practices for Docker builds for Node.js. I'm still not sure where the problem is (Enzyme, maybe?). But I found three useful resources for Docker and Node.js: Docker and Node.js Best Practices Node + Docker Hello World, for Showing Good Defaults for Using Node.
Read more →

Friday Picks 028

Read more →

Decked Out With Black Friday Swag

Read more →