Resources:
- https://www.w3.org/TR/WCAG21/
- https://webaim.org/
- https://www.apple.com/accessibility/
- https://a11y-101.com/
- https://www.microsoft.com/design/inclusive/
- https://marcysutton.github.io/gatsby-a11y-workshop/
Tools:
const {useCallback, useEffect, useReducer, useRef} = require('react'); | |
let effectCapture = null; | |
exports.useReducerWithEmitEffect = function(reducer, initialArg, init) { | |
let updateCounter = useRef(0); | |
let wrappedReducer = useCallback(function(oldWrappedState, action) { | |
effectCapture = []; | |
try { | |
let newState = reducer(oldWrappedState.state, action.action); |
While the public API intended for users to use is the scheduler
package, the reconciler currently
does not use scheduler
's priority classes internally.
ReactFiberScheduler
has its own internal "mini-scheduler" that uses the scheduler
package
indirectly for its deadline-capable scheduleCallback.
This is kind of a documentation of implementation details that I suppose will be gone by the end of the year, but what can you do.
#!/usr/bin/env bash | |
cd <projectDir> | |
currentBranch=$(git rev-parse --abbrev-ref HEAD) | |
git checkout master | |
git pull | |
git checkout $currentBranch | |
git rebase master |
The scope of a variable is the region of the program in which you can directly access the variable:
if (true) {
let x = 123;
}
Here, the scope of x
is the then-block of this if-then-else statement.
let cache = new Map(); | |
let pending = new Map(); | |
function fetchTextSync(url) { | |
if (cache.has(url)) { | |
return cache.get(url); | |
} | |
if (pending.has(url)) { | |
throw pending.get(url); | |
} |
/** | |
* - check symlink in depencency and devDepency | |
* - if found, generate rn-cli-config.js | |
* - react-native start with rn-cli-config | |
*/ | |
const packageJson = require('./package.json'); | |
const fs = require('fs'); | |
const exec = require('child_process').execSync; | |
const RN_CLI_CONFIG_NAME = `rn-cli-config-with-links.js`; |
import React from 'react' | |
import revalidation from 'revalidation' | |
import gql from 'graphql-tag.macro' | |
import { filter } from 'graphql-anywhere' | |
import { curry } from 'ramda' | |
import { compose, withProps, withHandlers } from 'recompose' | |
import { graphql } from 'react-apollo' | |
import { Button } from '../common/styled' | |
import { getValue } from '../form/utils' | |
import { isRequired } from '../../utils/validation' |
import Reconciler from 'react-reconciler' | |
import omit from 'lodash/omit' | |
import capitalize from 'lodash/capitalize' | |
import { actions as elementActions } from './store/elements' | |
import * as Elements from './elements' | |
const roots = new Map() | |
const emptyObject = {} | |
const Renderer = Reconciler({ |
How do you send information between clients and servers? What format should that information be in? What happens when the server changes the format, but the client has not been updated yet? What happens when the server changes the format, but the database cannot be updated?
These are difficult questions. It is not just about picking a format, but rather picking a format that can evolve as your application evolves.
By now there are many approaches to communicating between client and server. These approaches tend to be known within specific companies and language communities, but the techniques do not cross borders. I will outline JSON, ProtoBuf, and GraphQL here so we can learn from them all.