Skip to content

Instantly share code, notes, and snippets.

View oreqizer's full-sized avatar
💪
Gainz o'clock

Boris oreqizer

💪
Gainz o'clock
View GitHub Profile

I've encountered many people being oblivious to the way web application rendering works. Initial rendering is an important topic, especially in the context of SEO and performance, so brew yourself a nice cup of tea and pay attention.

Now, I will be talking about customer-facing web apps. When building internal tools or toy apps, it does not really matter. Just pick whichever is the simplest to implement (which is CSR in most cases).

There are three stages of the initial app render:

<div id="app"></div>
@oreqizer
oreqizer / game.txt
Created October 16, 2019 15:10
flickgame
{"gameLink":"www.flickgame.org","canvasses":[[1619,"7",1,"f",3,"7",12,"f",7,"7",34,"f",32,"7",18,"f",3,"7",7,"f",24,"7",7,"f",3,"7",10,"f",3,"7",12,"f",7,"7",47,"f",10,"7",2,"f",7,"7",18,"f",3,"7",11,"f",16,"7",11,"f",3,"7",10,"f",3,"7",12,"f",7,"7",59,"f",7,"7",18,"f",3,"7",16,"f",3,"7",19,"f",3,"7",10,"f",3,"7",12,"f",7,"7",59,"f",7,"7",18,"f",3,"7",16,"f",3,"7",19,"f",3,"7",10,"f",3,"7",12,"f",7,"7",59,"f",7,"7",18,"f",3,"7",16,"f",3,"7",19,"f",3,"7",10,"f",3,"7",12,"f",7,"7",59,"f",7,"7",18,"f",3,"7",16,"f",3,"7",19,"f",3,"7",10,"f",3,"7",12,"f",7,"7",59,"f",7,"7",18,"f",3,"7",16,"f",3,"7",19,"f",3,"7",10,"f",3,"7",12,"f",7,"7",59,"f",7,"7",18,"f",3,"7",16,"f",3,"7",19,"f",3,"7",10,"f",3,"7",12,"f",7,"7",59,"f",7,"7",18,"f",3,"7",16,"f",3,"7",19,"f",3,"7",10,"f",3,"7",12,"f",7,"7",59,"f",7,"7",18,"f",3,"7",16,"f",3,"7",19,"f",3,"7",10,"f",3,"7",12,"f",7,"7",59,"f",7,"7",18,"f",3,"7",16,"f",3,"7",19,"f",3,"7",10,"f",3,"7",12,"f",7,"7",59,"f",7,"7",18,"f",3,"7",16,"f",3,"7",19,"f",3,"7",10,"f",3,"7",12,"f",
@oreqizer
oreqizer / RestPost.jsx
Last active November 17, 2018 16:34
Kiki's thing
import * as React from "react";
class RestPost extends React.Component {
constructor(props) {
super(props);
this.state = { firstName: "", lastName: "", country: "", university: "" };
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
@oreqizer
oreqizer / index.js
Created April 28, 2017 13:22
Storybook groups brainstorm
import React from 'react';
import { storiesOf, action, linkTo, getStorybook } from '@kadira/storybook';
import Button from './Button';
import Welcome from './Welcome';
import { WithNotes } from '../notes-addon';
// import { addGroups, Group } from 'storybook-groups';
const Group = ({ children }) => React.Children.only(children);
@oreqizer
oreqizer / main.go
Created April 24, 2017 18:32
Go web server
package main
import (
"log"
"net/http"
)
func main() {
http.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello world"))

Keybase proof

I hereby claim:

  • I am oreqizer on github.
  • I am oreqizer (https://keybase.io/oreqizer) on keybase.
  • I have a public key whose fingerprint is 6381 B42B 3743 FEA9 113E AAB2 D314 812A 32E0 151E

To claim this, I am signing this object:

@oreqizer
oreqizer / DumbTodo.jsx
Created December 2, 2016 13:58
An example of a very dumb todo component.
import React from 'react';
import Todo from '../../../universal/containers/Todo';
const doneStyle = {
textDecoration: 'line-through',
};
const notDoneStyle = {
textDecoration: 'none',
@oreqizer
oreqizer / todoSelector.js
Last active July 6, 2017 11:53
An example of state-less todo selector.
import { createSelector } from 'reselect';
const allTodoSelector = props => props.todos; // an array of todos
const filterSelector = props => props.filter; // a url parameter
const todoSelector = createSelector(
[allTodoSelector, filterSelector],
(todos, filter = 'all') => {
switch (filter) {
case 'all':
@oreqizer
oreqizer / SelectedTodos.jsx
Created December 2, 2016 13:37
An example of a context-less component with a selector.
// @flow
import React from 'react';
import Todo from '../containers/Todo';
import todoSelector from './todoSelector';
type Props = {
filter: string,
header: string,