Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
| /** | |
| * # `<Image>` | |
| * | |
| * This component is a merge between `next/image` and `Chakra-ui`. | |
| * - last updated on 2023-08-08 with `next/image` 13.4.13 and `chakra-ui/react` 2.8.0 | |
| * - https://github.com/vercel/next.js/blob/v13.4.13/packages/next/src/client/image-component.tsx | |
| * - https://github.com/vercel/next.js/blob/canary/packages/next/src/client/image-component.tsx | |
| * - https://github.com/vercel/next.js/commits/canary/packages/next/src/client/image-component.tsx | |
| * - https://github.com/vercel/next.js/compare/v13.4.4...canary | |
| * |
In case anyone else wants to play with Zig on webassembly, here's what you need to do to make it work on a mac today.
You'll need LLVM to output to the WASM target. This has just been added by default in trunk, so if LLVM >7 is available, you might be able to just brew install llvm.
If you have wasm support already you should see:
$ llc --version
| const mapValuesAsync = (obj, asyncFn) => { | |
| const keys = Object.keys(obj); | |
| const promises = keys.map(k => { | |
| return asyncFn(obj[k]).then(newValue => { | |
| return {key: k, value: newValue}; | |
| }); | |
| }); | |
| return Promise.all(promises).then(values => { | |
| const newObj = {}; | |
| values.forEach(v => { |
We dropped Lerna from our monorepo architecture in PouchDB 6.0.0. I got a question about this from @reconbot, so I thought I'd explain our reasoning.
First off, I don't want this post to be read as "Lerna sucks, don't use Lerna." We started out using Lerna, but eventually outgrew it because we wrote our own custom thing. Lerna is still a great idea if you're getting started with monorepos (monorepi?).
Backstory:
| { fontWeight: '100' }, // Thin | |
| { fontWeight: '200' }, // Ultra Light | |
| { fontWeight: '300' }, // Light | |
| { fontWeight: '400' }, // Regular | |
| { fontWeight: '500' }, // Medium | |
| { fontWeight: '600' }, // Semibold | |
| { fontWeight: '700' }, // Bold | |
| { fontWeight: '800' }, // Heavy | |
| { fontWeight: '900' }, // Black |
Redux was developed to achieve hot reloading global state and state changing logic. To achieve that it was necessary for state changes to be run with pure functions and the state has to be immutable. Now you can change the logic inside your reducer and when the application reloads Redux will put it in its initial state and rerun all the actions again, now running with the new state changing logic.
Cerebral had no intention of achieving hot reloading. Cerebral was initially developed to give you insight into how your application changes its state, using a debugger. In the Redux debugger you see what actions are triggered and how your state looks after the action was handled. In Cerebral you see all actions fired as part of a signal. You see asynchronous behaviour, paths taken based on decisions made in your state changing flow. You see all inputs and outputs produced during the flow and you even
| /** | |
| * Fancy ID generator that creates 20-character string identifiers with the following properties: | |
| * | |
| * 1. They're based on timestamp so that they sort *after* any existing ids. | |
| * 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
| * 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
| * 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
| * latter ones will sort after the former ones. We do this by using the previous random bits | |
| * but "incrementing" them by 1 (only in the case of a timestamp collision). | |
| */ |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.