Skip to content

Instantly share code, notes, and snippets.

View stevekinney's full-sized avatar

Steve Kinney stevekinney

View GitHub Profile
[user]
name = Steve Kinney
email = hello@stevekinney.net
[credential]
helper = osxkeychain
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
export NVM_DIR="/Users/stevekinney/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
export GREP_OPTIONS='--color=auto'
export CLICOLOR=1
export LESS='--quit-if-one-screen --RAW-CONTROL-CHARS --no-init --tabs=4'
export LS_COLORS=GxFxCxDxBxegedabagaced
export TREE_COLORS='di=1;36:ln=1;35:so=1;32:pi=1;33:ex=1;31:bd=34;46:cd=34;33:fi=0:or=4;31'
export LSCOLORS=$LS_COLORS
export EDITOR=vim

Frontend Masters: Introduction to Nodebots

You should have the following completed on your computer before the workshop:

Frontend Masters—Deploying Full Stack: Node.js & React on AWS

You should have the following completed on your computer before the workshop:

  • Have Node.js installed on your system. (Recommended: Use nvm.)
    • Unfortunately, you'll need to be on Node 9.x or earlier. Dependencies are hard and one of the dependencies of one of our dependencies is set to not allow Node 10.x.
    • Install yarn with brew install yarn.
  • Create an AWS account. (This will require a valid credit card.)
  • Install multi-factor authentication app (e.g. Authy, Google Authenticator, Duo).
  • Install the AWS CLI. (brew install awscli should do the trick. Otherwise, you'll need Python and PIP, which you can install using brew install python.)
{
"Records": [
{
"cf": {
"config": {
"distributionDomainName": "d3j9cel339anj4.cloudfront.net",
"distributionId": "E3U8Q34NJRFZ8Y",
"eventType": "viewer-request",
"requestId": "EvyNcmriLUwwIKecK5dpPHehUpzBcO2BolZQ9O3Q95A9DxtOuEwRUw=="
},
language: node_js
node_js:
- '8'
cache:
yarn: true
directories:
- node_modules
script:
- yarn test
before_deploy:

Node.js Serverless Design and Best Practices

Bryan Hughes

Bryan Hughes
  Serverless is taking the backend world by storm, and for good reason. It promises infinite scalability and never having to manage a server again. Serverless mostly achieves these goals the same way that functional programming does. You define inputs and outputs without using state...and state is what makes scaling hard.   Much like functional programming though, being productive in serverless requires a tricky shift in mindset. This workshop will walk you through creating a serverless application with Node.js, teach you best practices, and teach you how to think serverless.  

class Board {
constructor(min = 1, max = 30) {
this.spaces = {};
for (let space = min; space <= max; space++) {
this.spaces[space] = space;
}
// Ladders
this.spaces[2] = 21;
  • State: as much as you need and as little as you can get away with
  • Prefer stateless components
  • Keep logic out of your components
  • Lazy-load and chunk components when aggressively
  • Assume Asynchrony (See above; also—don’t unleash Zalgo)
  • Use UI components
  • Prefer renderProps to large components
  • Start with a story in the storybook
  • Use the adapter pattern for managing state
  • If the data layer promise resolves—assume everything worked out. Do not try to read responses in your components.