Skip to content

Instantly share code, notes, and snippets.

View glennreyes's full-sized avatar
🎵

Glenn Reyes glennreyes

🎵
View GitHub Profile
@glennreyes
glennreyes / webpack.config.js
Last active January 16, 2019 03:22
How to disable Code Splitting in webpack
module.exports = {
module: {
rules: [
{
test: /\.(js|jsx)$/,
loader: require.resolve('babel-loader'),
include: ['src'],
options: {
presets: [
'dynamic-import-node',
@glennreyes
glennreyes / create-favicon.sh
Created August 17, 2017 14:45
Creates a favicon.ico with ImageMagick
# Creates a favicon.ico with ImageMagick
convert favicon.png -define icon:auto-resize=256,192,128,64,48,32,16 favicon.ico

Leveraging code-splitting in React apps

Why consider code split?

  • Imagine regular 3G connection on mobile devices
  • Seconds until first meaningful paint?
  • Mobile trend

How?

  • Explain import();
  • Example import();
# Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Homebrew packages
brew install git
brew install java
brew install mackup
@glennreyes
glennreyes / lerna-now.md
Created March 11, 2017 18:58
Deployment script for a single lerna packge using now.sh
lerna exec --concurrency 1 --scope package -- now -t $ZEIT_TOKEN

Keybase proof

I hereby claim:

  • I am glennreyes on github.
  • I am glennreyes (https://keybase.io/glennreyes) on keybase.
  • I have a public key whose fingerprint is B921 FD09 9BB6 AB54 93ED D30E E798 7280 C8EF E5AB

To claim this, I am signing this object:

@glennreyes
glennreyes / HotErrorClient.jsx
Created October 22, 2016 10:16
Example using redbox-react
/* @flow */
/* eslint-disable global-require, no-console */
import React from 'react';
import { render } from 'react-dom';
import Redbox from 'redbox-react';
const clearConsole = () => {
if (typeof console.clear === 'function') {
@glennreyes
glennreyes / webpack.config.js
Created September 14, 2016 09:17
Custom props & media config in webpack
const customMedia = require('./postcss/customMedia');
const customProperties = require('./postcss/customProperties');
module.exports = {
...
plugins: [
postcss: () => [
postcss: () => [
cssnext({ features: { customMedia, customProperties } }),
],
@glennreyes
glennreyes / 150510-notes.md
Created June 2, 2016 18:11
Notes on Progressive Webapps with Nolan Lawson

Progressive Webapps

Application Shell

  • Progressive rendering
    • Don't show a blank screen
  • Progressive enhancement

Strategies

  • Server-side HTML
  • React