- Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
- pathname - The "file/directory" portion of the URL, like
invoices/123 - search - The stuff after
?in a URL like/assignments?showGrades=1. - query - A parsed version of search, usually an object but not a standard browser feature.
- hash - The
#portion of the URL. This is not available to servers inrequest.urlso its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things. - state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
- pathname - The "file/directory" portion of the URL, like
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
[12:14 AM] acreddy : are hooks value stored in fiber?
[10:40 AM] ghardin137 : not really
[10:50 AM] acemarke : @acreddy, @ghardin137 : yes they are, actually.
A "fiber" is a plain JS object that React uses to store bookkeeping information on each rendered component in the tree. The linked list of hooks is indeed stored as a field on the fiber for that component
| #!/usr/bin/env bash | |
| # Bash script to download Apache NetBeans and (optionally) a JDK, then package into an AppImage. | |
| # | |
| # Use at own risk! Will create a /build directory inside current directory for downloading and | |
| # building. AppImage will be created in current directory. | |
| # | |
| # (c) 2020 Neil C Smith - [email protected] | |
| shopt -s extglob |
| import { Suspense, useLayoutEffect, useRef, useState } from 'react'; | |
| type IFrameProps = React.ComponentPropsWithRef<'iframe'> & { | |
| fallback?: JSX.Element; | |
| }; | |
| export function IFrame(props: IFrameProps) { | |
| const { fallback, ...rest } = props; | |
| return ( |
| /* | |
| * credit to Dhrumil Shah (@wandcrafting) and Robert Haisfield (@RobertHaisfield) | |
| * for the original concept which was part of their RoamGames submission | |
| * and can be found at: https://www.figma.com/file/5shwLdUCHxSaPNEO7pazbe/ | |
| * | |
| */ | |
| /* ======= OPTIONS ======== */ | |
| /* note: if you change these, reload the page to see the effect */ |
| /** | |
| * RuntimeGlobalsChecker | |
| * | |
| * You can use this utility to quickly check what variables have been added (or | |
| * leaked) to the global window object at runtime (by JavaScript code). | |
| * By running this code, the globals checker itself is attached as a singleton | |
| * to the window object as "__runtimeGlobalsChecker__". | |
| * You can check the runtime globals programmatically at any time by invoking | |
| * "window.__runtimeGlobalsChecker__.getRuntimeGlobals()". | |
| * |
| export class Cache<T extends object, K> { | |
| items = new WeakMap<T, K>() | |
| get<P extends T>(item: P, cb: (item: P) => K) { | |
| if (!this.items.has(item)) { | |
| this.items.set(item, cb(item)) | |
| } | |
| return this.items.get(item)! | |
| } |
| (async () => { | |
| const { getBlocksuiteReader } = await import( | |
| "https://unpkg.com/[email protected]/dist/index.js" | |
| ); | |
| const workspace = window.currentBlockSuiteWorkspace; | |
| const workspaceId = workspace.room; | |
| const reader = getBlocksuiteReader({ | |
| workspaceId: workspaceId, | |
| Y: workspace.constructor.Y, | |
| }); |