Each day at our company, developers are required to document their activities, painstakingly jotting down their daily work and future plans. A monotonous chore that I just really dislike.
So now, there's a scribe for that :
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
</head> | |
<body> | |
<div id="app"></div> | |
<script type="module"> |
Each day at our company, developers are required to document their activities, painstakingly jotting down their daily work and future plans. A monotonous chore that I just really dislike.
So now, there's a scribe for that :
This for loop:
for (let i = 0, getI = () => i; i < 3; i++)
console.log(getI());
unrolls to:
// TODO: make `pages` optional and measure the div when unspecified, this will | |
// allow more normal document flow and make it easier to do both mobile and | |
// desktop. | |
import { | |
createContext, | |
useCallback, | |
useContext, | |
useEffect, | |
useMemo, | |
useRef, |
import { ComponentProps, FC, Fragment } from "react"; | |
export interface ProvidersProps { | |
children: React.ReactNode; | |
} | |
export type ProviderWithProps = [FC<ProvidersProps>, Object]; | |
/** | |
* Function that combines all the context providers into a single one. |
This document outlines how to model a common organization-based permission system in Hasura. Let's assume that you have some table structure like the following:
Table Name | Columns | Foreign Keys |
---|---|---|
User | id, name, email | |
Organization User | id, user_id, organization_id | user_id -> user.id, organization_id -> organization.id |
Organization | id, name |
import React from "react"; | |
import { Link } from "react-router-dom"; | |
export function createResource(getPromise) { | |
let cache = {}; | |
let inflight = {}; | |
let errors = {}; | |
function load(key) { | |
inflight[key] = getPromise(key) |
#[no_mangle]
pub extern fn double_input(input: i32) -> i32 {
input * 2
I heard some points of criticism to how React deals with reactivity and it's focus on "purity". It's interesting because there are really two approaches evolving. There's a mutable + change tracking approach and there's an immutability + referential equality testing approach. It's difficult to mix and match them when you build new features on top. So that's why React has been pushing a bit harder on immutability lately to be able to build on top of it. Both have various tradeoffs but others are doing good research in other areas, so we've decided to focus on this direction and see where it leads us.
I did want to address a few points that I didn't see get enough consideration around the tradeoffs. So here's a small brain dump.
"Compiled output results in smaller apps" - E.g. Svelte apps start smaller but the compiler output is 3-4x larger per component than the equivalent VDOM approach. This is mostly due to the code that is usually shared in the VDOM "VM" needs to be inlined into each component. The tr
import React from "react" | |
import PropTypes from "prop-types" | |
export default class LogIn extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
email: '', | |
email_ready: undefined, | |
password: '', |