Sign in

Cory House

@housecor.com
2.2K followers 61 following 136 posts

Courses: pluralsight.com YouTube: youtube.com/@housecor Consulting: reactjsconsulting.com ⚛️

PostsRepliesMedia
Cory House @housecor.com · 04/09/2025
Convex
010
Cory House @housecor.com · 03/09/2025
How I handled React state over 10 years: 2014: Class state 2016: Redux 2018: useState, useReducer, useContext 2020: React query 2021: Zustand for globals 2024: useOptimistic, useTransition, useFormStatus, useActionState, RSC 2025: Tanstack DB or sync engine (Zero, Electric, Convex)
1130
Cory House @housecor.com · 02/06/2025
TypeScript syntax is often inspired by JavaScript. In some cases, TS even uses the exact same syntax as JS for a different purpose. The difference? JS features focus on values. TS features focus on types. Here's a few examples.
040
Cory House @housecor.com · 30/05/2025
Are TypeScript types worth testing? Sometimes. Here's when, and how. www.youtube.com/shorts/Uv7r-...
youtube.com
Should I test my TypeScript types? #coding #programming
YouTube video by Cory House
010
Cory House @housecor.com · 29/05/2025
Problem: I want to enforce a string format at compile time. Solution: Use a template literal type. Full "TypeScript: Deep Dive" course: dometrain.com/course/deep-...
000
Cory House @housecor.com · 28/05/2025
Problem: I want to ensure my switch statement handles all potential cases. Solution: Use TypeScript's never type. Here's how: Full course: dometrain.com/course/deep-...
040
Cory House @housecor.com · 24/05/2025
Problem: You have complex logic for narrowing a TypeScript type that you'd like to reuse in a few spots. Solution: Consider an assertion function. 20% off the full course: dometrain.com/course/deep-...
150
Cory House @housecor.com · 23/05/2025
It’s live! “TypeScript: Deep Dive” explores advanced TS concepts: - Utility types - Generics - Mapped types - Conditional types - Template literal types - Runtime validation - Decorators - tsconfig techniques And over 250+ examples! Get 20% off at launch here: dometrain.com/course/deep-...
061
Cory House @housecor.com · 22/05/2025
LLMs are handy when working with the command line. I wanted a count of all the exercise files in my new course. ChatGPT provided the correct Bash command immediately.
240
Cory House @housecor.com · 21/05/2025
It’s done! I’ve been heads down for 3 months creating my most ambitious course yet: “TypeScript: Deep Dive” Just recorded the final clip. This course is 7 hours of advanced features, tips, patterns, and tricks to level up your TS skills. Publishing this week on Dometrain!
050
Cory House @housecor.com · 18/05/2025
Tesla paid back the loan, and did so early. Implying they survived merely because of a loan is reductive. SpaceX survives because, like Tesla, they're profitable. They're able to do things cheaper than alternatives, because they innovated and created reusable rockets.
110
Cory House @housecor.com · 18/05/2025
Many current and former Tesla employees received stock options and are now quite wealthy. Tesla is an obvious American success story. Without Tesla, EVs would likely still be rare. What system do you propose to avoid successful entrepreneurs getting too wealthy for your taste?
110
Cory House @housecor.com · 18/05/2025
With 2, we may never bother becoming stricter. And any new code is held to a low standard, which creates "type debt". With 1, new code is held to a strict standard, and existing code can selectively have looser typing rules via nested tsconfigs, or by disabling TS in spots if necessary.
260
Cory House @housecor.com · 18/05/2025
When migrating a codebase from JS to TS, there are two schools of thought: 1. Start strict, and loosen in spots as needed. 2. Start loose, and migrate to stricter rules over time. I prefer 1. It's safer. Default strict. Loosen when necessary.
1102
Cory House @housecor.com · 13/05/2025
Just realized Vitest now has built in support for testing TypeScript types. How? It includes expect-type now by default. Handy. Example:
import { assertType, expectTypeOf } from 'vitest'
import { mount } from './mount.js'

test('my types work properly', () => {
  expectTypeOf(mount).toBeFunction()
  expectTypeOf(mount).parameter(0).toMatchTypeOf<{ name: string }>()  

  // @ts-expect-error name is a string
  assertType(mount({ name: 42 }))
})
171
Cory House @housecor.com · 13/05/2025
How? Because he helped build multiple extremely valuable companies. His wealth primarily stems from *equity* in those companies, and he funded them in hard times despite many near bankruptcies. Both SpaceX and Tesla would likely have went under without his financial support.
210
Cory House @housecor.com · 09/05/2025
I'm saying it's good...but it's important to know how to code so one can debug and validate the results
020
Cory House @housecor.com · 08/05/2025
Vibe coding is the modern version of copy/pasting code you don’t understand from Stack Overflow. It seems fine at first, but at some point you need to understand how to code.
2162
Cory House @housecor.com · 05/05/2025
Example: The Dropbox team used this pattern to test many OS and file system edge cases quickly on CI.
020
Cory House @housecor.com · 05/05/2025
Result: Now we can code and test against a mocked implementation in non-prod environments. The mocked implementation can be deterministic and fast, and thus allow quickly testing our business logic against many scenarios. In prod, the wrapper implementation merely forwards to the real APIs.
120
Cory House @housecor.com · 05/05/2025
Problem: Some interfaces like dates, times, localStorage, the URL, and the file system are “globals” that may change at any time. This makes it difficult to set up complex edge cases and hampers testing. Solution: Instead of coding against these APIs directly, wrap access in an interface.
160
Cory House @housecor.com · 03/05/2025
Still early so can’t say
010
Cory House @housecor.com · 02/05/2025
Problem: When I correct an LLM it “forgets” and makes the mistake again later. Solution: 1. Create a llm-learning file. 2. Tell the LLM to write to that file each time I correct it. (I use copilot-instruction.md to instruct Copilot) Now it “learns” over time!
281
Cory House @housecor.com · 19/04/2025
Oooof wow
010
Cory House @housecor.com · 19/04/2025
Could use linting palantir.github.io/tslint/rules...
palantir.github.io
Rule: no-object-literal-type-assertion
TSLint documentation. A linter for the TypeScript language.
020
Cory House @housecor.com · 19/04/2025
Tried using Zod for that?
110
Cory House @housecor.com · 19/04/2025
I validate all my runtime inputs: -Cookies -Local storage -URL params -API responses -Form values -Environment variables I use Zod to validate runtime inputs. So, I don’t need to worry if the input is malformed. I show how I work with Zod in detail in TypeScript: Deep Dive”. Publishing in May!
0140
Cory House @housecor.com · 17/04/2025
Sad but true!
030
Cory House @housecor.com · 17/04/2025
Claim: "Those who can't do, teach". Reality: "To go deeper, teach." For example, I've worked successfully in TypeScript for years. But now that I'm writing a deep dive course, I'm finding edge cases that I hadn't naturally explored as a practitioner. Teaching forces me to grow.
3402
Cory House @housecor.com · 17/04/2025
I'm reviewing a TypeScript codebase that's filled with type assertions like this. return fieldErrors as { [key: string]: { errors: string[] } } Type assertions are NOT safe. It's saying "Trust me TypeScript, it's fine." Instead, validate. Consider Zod, ArkType, etc.
3120
Cory House @housecor.com · 13/04/2025
There are many JS runtimes - Node, Deno, Bun, etc. Just learned about a new one: Bare. Bare is unique: - Light (runs on mobile) - No server (great for P2P apps) - Not tied to a specific JS engine. - Separate modules (Upgrade modules when desired. Install what you need) More: bare.pears.com
0101
Cory House @housecor.com · 10/04/2025
“We don’t have time to write tests” isn’t a valid excuse anymore. I'm presenting "Creating Automated Tests with AI" April 23 at 11AM ET. In this webinar I'll show how to quickly generate tests using ChatGPT, Copilot, and Applitools Autonomous. Sign up: applitools.info/8y6
applitools.info
Creating Automated Tests with AI | April 23 • 11 AM ET
Learn how to use GitHub Copilot, ChatGPT, and Applitools Autonomous to generate reliable automated tests—fast. In this session with Cory House, discover modern AI-driven workflows for Playwright, Vite...
040
Cory House @housecor.com · 08/04/2025
TypeScript has around 20 utility types. There are 100's of handy 3rd-party utility types too. Here are the top 4 I found while researching "TypeScript: Deep Dive" (publishing soon). github.com/millsp/ts-to... github.com/piotrwitek/u... github.com/andnp/Simply... github.com/sindresorhus...
090
Cory House @housecor.com · 02/04/2025
React Server Components have gotten a lot of hate recently. I'm not saying they're perfect, but this short comparison shows why I still think they're compelling. youtu.be/LdFPUzkaiCA
youtu.be
Why React Server Components? WAY less code.
YouTube video by Cory House
040
Cory House @housecor.com · 02/04/2025
I agree
010
Cory House @housecor.com · 28/03/2025
I've heard people say "spelling mistakes in code are harmless". I disagree. Spelling mistakes slow reading, create confusion, and can lead to bugs. Solution: Run cspell as part of your CI process. Here's an example cspell just found - a misspelled style that wasn't applying.
<Box sx={{ alignItems: 'cenetr' }}>
371
Cory House @housecor.com · 27/03/2025
PSA 📢: This isn’t error handling. .catch((e) => console.log(e)) It's error swallowing. The user isn’t watching the console. Solution: Show the user a friendly non-technical message like "Sorry, an error occurred. Please try again later."
080
Cory House @housecor.com · 26/03/2025
Oops, I didn't even realize depcheck was no longer maintained. I use Knip and agree it's preferable but I was using Depcheck for a moment since it's easier to run quickly with no config when auditing a project.
140
Cory House @housecor.com · 26/03/2025
TypeScript radically improved my frontend code. Here are 7 reasons I use TypeScript instead of JavaScript. youtube.com/shorts/fQaC0...
youtube.com
7 Reasons I Use TypeScript instead of JavaScript #coding #programming
YouTube video by Cory House
061
Cory House @housecor.com · 25/03/2025
Problem: Unused npm dependencies. They make package.json harder to read, bloat node_modules, waste our time updating packages we don’t use, and create confusion about what our project requires. Solution: npx depcheck It lists unused dependencies.
2120
Cory House @housecor.com · 21/03/2025
Problem: I want to see a list of the settings I've changed in VS Code. Solution: Search for @modified. This displays a list of modified settings. I used this today because I recently changed a setting that I wanted to revert, and couldn't recall the setting's name.
1152
Cory House @housecor.com · 20/03/2025
The types are in comments which can be optionally stripped during a build but are ignored in the browser either way
010
Cory House @housecor.com · 20/03/2025
Example of needless RSC payload bloat: Passing a large array of objects with many properties from a server component to a client component when only some of the properties are used by the client component. Solution: Only pass necessary data via props from server to client.
020
Cory House @housecor.com · 20/03/2025
A React RSC payload includes 3 things: 1. The rendered server component. 2. Client component placeholders, with a reference to the JS chunk containing the client code. 3. Props passed from server components to client components. 3 is the place to watch for needless bloat.
150
Cory House @housecor.com · 19/03/2025
yep
020
Cory House @housecor.com · 19/03/2025
In TypeScript, there are at least 4 ways to implement immutability. Here's how I choose between them. youtube.com/shorts/pwtKr...
youtube.com
4 Ways to Make Things Immutable in TypeScript #coding #programming
YouTube video by Cory House
1110
Cory House @housecor.com · 18/03/2025
Now that Node, Bun, and Deno can run TS files directly without compilation, using JSDoc syntax to declare TypeScript types is even harder to justify. JSDoc syntax is more verbose, lacks full feature support, and is harder to read. Look at this comparison. Easy choice.
// Prefer this
type User = {
  /** User's ID */
  id: number, 
  
  /** User's name. */
  name: string
};

// Over this:
/**
 * @typedef {Object} User
 * @property {number} id - User's ID.
 * @property {string} name - User's name.
 */
2120
Cory House @housecor.com · 17/03/2025
In TypeScript, Interfaces and Types are often interchangeable. But these six features only work with types. youtube.com/shorts/tR8ps...
youtube.com
6 type only TypeScript features #coding #programming #typescript #code #javascript
YouTube video by Cory House
1161
Cory House @housecor.com · 14/03/2025
Learn TypeScript in 60 seconds.
0120
Cory House @housecor.com · 13/03/2025
TypeScript is great. But it has 3 features that you should probably avoid. Here's what I suggest using instead. Clip from "TypeScript: Getting Started" on Dometrain youtube.com/shorts/tr39p...
youtube.com
TypeScript: 3 Features to Avoid
YouTube video by Cory House
060