Skip to content

Instantly share code, notes, and snippets.

Avatar
🌎

Flávio Carvalho imflavio

🌎
View GitHub Profile
@imflavio
imflavio / README.md
Created Oct 30, 2020 — forked from tannerlinsley/README.md
Replacing Create React App with the Next.js CLI
View README.md

Replacing Create React App with the Next.js CLI

How dare you make a jab at Create React App!?

Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.

Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.

So why

View nextjs dockerfile
# This gets our prod dependencies installed and out of the way
FROM node:12-alpine as base
ENV PORT=3000
EXPOSE $PORT
ENV NODE_ENV=production
WORKDIR /app
RUN apk update && apk add --no-cache tini
# Allows us to stop the server with Ctrl + C
ENTRYPOINT ["/sbin/tini", "--"]
COPY package*.json ./
View ts_ci_poc.ts
import { generateGitlabCIContents } from '~/gitlab'
import { CIConfig, CI } from '~/interfaces'
describe('[GITLAB]', () => {
it('should output the correct gitlab config', () => {
enum Stages {
INSTALL = 'install',
BUILD = 'build',
TEST = 'test',
DEPLOY = 'deploy',
View machine.js
Machine({
id: 'marxent',
initial: 'PENDING',
context: {
token: null,
error: null,
},
states: {
PENDING: {
on: {
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View remove node_modules
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
View flat sort
input.flat(Infinity).sort()
You can’t perform that action at this time.