These are my unstructured notes from the workshop. Read with caution (they're biased to my own interpretation).
1,000,000 Julian.com visitors
Part 1: What's your objective for your article?
Part 2: pair it with an objective
const stages = ['production', 'staging', 'development', 'test'] as const; | |
type Stage = typeof stages[number]; | |
function getStage(stages: Stage[]) { | |
if (!stages.length) return 'production'; | |
for (const stage of stages) { | |
// if any of the provided stages is production, assume we are in production | |
if (stage === 'production') { |
Memoization is a somewhat fraught topic in the React world, meaning that it's easy to go wrong with it, for example, by [making memo()
do nothing][memo-pitfall] by passing in children to a component. The general advice is to avoid memoization until the profiler tells you to optimize, but not all use cases are general, and even in the general use case you can find tricky nuances.
Discussing this topic requires some groundwork about the technical terms, and I'm placing these in once place so that it's easy to skim and skip over:
I've recently ran into a pitfall of [React.memo()
][memo] that seems generally overlooked; skimming over the top results in Google just finds it mentioned in passing in a [React issue][regit], but not in the [FAQ] or API [overview][react-api], and not in the articles that set out to explain React.memo()
(at least the ones I looked at). The issue is specifically that nesting children defeats memoization, unless the children are just plain text. To give a simplified code example:
const Memoized = React.memo(({ children }) => (<div>{children}</div>));
// Won't ever re-render
<Memoized>bar</Memoized>
// Will re-render every time; the memoization does nothing
/** | |
* Example of running BrowserStacks Appium WikipediaSample test app locally | |
* using jest and async/await instead of promise chains. | |
* | |
* Before running, you should install appium and make sure that all dependencies | |
* are met with appium-doctor. Get started at: | |
* | |
* http://appium.io/docs/en/about-appium/getting-started/?lang=en | |
*/ |
Change your app.json to base-app.json and untrack the original file in your .gitignore
Then add something like
"generateConfig": "rimraf app.json && node generateConfig"
to your package.json
scripts, and yarn generateConfig && react-native-scripts start
to scripts like "start" or any others that may need app.json generated.
{ | |
"presets": ["es2015"], | |
"plugins": [ | |
"add-module-exports" | |
], | |
} |
// @flow | |
import React, { Component } from 'react'; | |
import { | |
AppRegistry, | |
Button, | |
StyleSheet, | |
Text, | |
View | |
} from 'react-native'; | |
import { |
<?php | |
/** | |
* Template Name: Testimonials - Native Functions | |
*/ | |
add_action( 'genesis_entry_content', 'prefix_output_testimonials' ); | |
/** | |
* Output ACF testimonials. | |
* | |
* @link https://acfextras.com/simple-testimonials-repeater-field/ |