Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.
This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async
+ await
.
{-# OPTIONS --type-in-type #-} | |
-- Taken from http://www.cs.nott.ac.uk/~psztxa/g53cfr/l20.html/l20.html | |
module _ where | |
open import Agda.Builtin.Unit | |
open import Agda.Builtin.Equality | |
data ⊥ : Set where |
See also Normative commits: es2016-normative-changes.md
.docx
to .html
class Deferred extends Promise { | |
constructor(executor) { | |
super(executor) | |
// These will be overwritten by the creator function | |
this._resolve = null | |
this._reject = null | |
} | |
resolve(value) { |
Many modern Rails application use third-party assets like JavaScript and CSS libraries or frameworks. In most cases these assets are minified and compressed by tools outside of the Rails asset pipeline. For example popular gem React on Rails uses WebPack to build JavaScript bundles. When we include these files to assets pipeline it goes to minify again. We can safely avoid double minification and reduce assets compilation time. Meanwhile it is still good to add a digest and gzip compression.
Savings are strongly depend on how many minified assets are used in an application, some numbers for a random application:
# standard setup
First, this is not about if
in JSX. It's just the simplest example
to talk about (and a lot of people tried to do it at first a long
time ago).
Some react components conditionally render content. When React first
went public, a lot of us coming from handlebars really wanted "if"
syntax. This gist isn't just about If
components though, it's about
Years ago, some smart folks that worked on JS engines realized that not all JS that's loaded into a page/app initially is needed right away. They implemented JIT to optimize this situation.
JIT means Just-In-Time, which means essentially that the engine can defer processing (parsing, compiling) certain parts of a JS program until a later time, for example when the function in question is actually needed. This deferral means the engine is freer to spend the important cycles right now on the code that's going to run right now. This is a really good thing for JS performance.
Some time later, some JS engine devs realized that they needed to get some hints from the code as to which functions would run right away, and which ones wouldn't. In technical speak, these hints are called heuristics.
So they realized that one very common pattern for knowing that a function was going to run right away is if the first character before the function
keyword was a (
, because that usually m
Kyle Simpson (@getify) wrote a very thoughtful post decrying optimize-js, which is a tool I wrote that exploits known optimizations in JavaScript engines to make JS bundles parse faster (especially minified bundles, due to what could be reasonably described as a bug in Uglify).
Kyle lays out a good case, but I tend to disagree with nearly all his points. So here's my rebuttal.
// @flow | |
import React, {Component, Element, PropTypes} from 'react' | |
import classNames from 'classnames' | |
import pure from 'recompose/pure' | |
import merge from 'lodash/merge' | |
import {createStyleSheet} from 'jss-theme-reactor' | |
import Logger from '../../util/Logger' | |
import {capitalizeFirstLetter} from '../../util/strings' | |
type DefaultProps = { |