
Software engineer | Tech entrepreneur | Founder @newbeeper | @fbjest maintainer. I love teaching and helping on all things code / startup / product. DMs open
London, England
Joined January 2012
- Tweets831
- Following558
- Followers344
- Likes3.4K
Pinned Tweet
Hey 👋
Twitter is the home of my content, so follow along for:
🧑💻 Web dev, functional programming & testing in #Typescript
🤩 Getting into / maintaining open source software
💸 Tech entrepreneurship
📢 Building in public
🧑🚀 Career advice
Wanna chat? My DMs are always open 😊
8
@mattphillips.io 🦋 retweeted
I’m going through the craziest burnout I’ve experienced in my ~17 year career
I’ve been sick for 16 days now, haven’t even been able to go for walks
I kind of fucking hate AI
I think all of these things are related
@mattphillips.io 🦋 retweeted
Is your Typescript project using strings everywhere? Probably. @mattphillipsio explains why this isn’t such a great idea and how you can make your app even more type safe.
Typescript: from stringly typed to strongly typed.
mattphillips.io/blog/from-st…
@mattphillips.io 🦋 retweeted
Haskell proves you don't need null at a high-level.
Rust proves you don't need null at a low-level.
Why are you still using null, again??
@mattphillips.io 🦋 retweeted
An interesting and well-written post with some compliments and concerns about React Server Components (and some other gripes about React in general):
mayank.co/blog/react-server-…
@mattphillips.io 🦋 retweeted
This is a little reason why I dislike Next's API choices. Because they always encapsulate back on "next".
This is how I want to declare this function instead:
function getIp(request) {
let forwadedRef = request.headers.get('x-forwarded-ref')
}
A subtle difference, right? But the implications are HUGE.
1. I can use "getIp" with any Fetch API request instance.
2. I am familiar with Request, so accessing headers is no feature to me. Use the platform and get better at JavaScript, not Next.
3. "getIp" has a clear input. Using "headers()" from Next is magic. Where does it comes from? How does it know which request I'm handling? I dislike magic in APIs, it makes them unpredictable and robs them of any educational value at its core.
4. Suddenly, this is standard JavaScript. There's no need for Next. Maybe that's the issue.
It's the subtle differences that make a huge impact on API design.
Replying to @leerob
The `headers()` function allows you to read from the incoming request. For example, here we're pulling `x-forwarded-for` (or `x-real-ip`) in a function.
Now that @reactjs has gone full circle to server-rendered websites like the good old php days...
how far away are we from the next cyclical trend of SPAs being the "correct" way to build websites for *insert reasons here* 🤷♂️
3
121
@mattphillips.io 🦋 retweeted
Looking forward to the day we as a community realized file system-based routing was a mistake. Once you glimpse over the initial appeal, you see there's a flaw on a flaw.
- File names aren't a format dynamic enough to support the extremely dynamic nature of routes;
- Concern separation is a mess (page.ts, layout.ts, foo.ts);
- Constant dance around include/exclude files; usually hard to collocate with non-route resources;
- Directory nesting only multiples the mess;
- It's the opposite of predictable;
- Searching for routes is a mess.
I wish we got back to a single "routes.ts" that declaratively lists all the application's routes. Why? Because for small (most) apps, it will have no experience degradation (even if you disregard all the improvements you gain). And for large apps, it will make the routes discoverable and easy to understand.
I can hardly justify file system-based routing for web applications.
Hey friends 👋 do I know any @reactnative experts?
I’m planning on building an app for fun / to learn RN, question is where do I begin?
Any advice would be greatly appreciated!
Some questions below 👇
1
4
225
Everyone sees the missing await / error handling which are trivial to solve. I see the lack of parsing the JSON into something trustworthy via Zod/io-ts.
I see so many bugs caused by devs trusting a value provided by the network. Also TS any on .json() aids this problem!
Am curious why @nextjs has opted for soft navigation caching by default in the app router??
I've been playing around with it today and it seems to be a minefield to actually get dynamic content to refetch when navigating and there is a plethora of related issues.
1
1
155
This reminds me of the classic:
"There are only two hard things in Computer Science: cache invalidation and naming things."
Surely @nextjs would be better off making the soft navigation caching opt-in rather than default?
That said maybe I'm missing obvious 🤷♂️
119
@mattphillips.io 🦋 retweeted
Replying to @jsjoeio
i would always prefer dependency injection or some other design change to mocking. and probably testing the logic on a higher level (not sure if your example is a simplified version if the real thing)
@mattphillips.io 🦋 retweeted
Easy to forget, but the debate about signals is the same one we had about 2-way data binding vs unidirectional data flow 10 years ago. Signals are mutable state! They’re bindings with a new name. The simplicity of UI as a function of state is lost when updates flow unpredictably.
This is so cool!!
I absolutely love Sandpack v1 but Sandpack v2 with Nodebox is just... 🤯
Amazing work by everyone at @codesandbox I can't wait to play with this properly 🎉
Introducing Sandpack 2.0 and Nodebox, a Node.js runtime for any browser.
📱 Run Node.js in any browser, any device
✨ Vite, Next.js, Astro & more
⚡ Super fast, with a Rust-based transpiler
Here’s why we believe this is HUGE 👇
codesandbox.io/blog/announci…
1
7
1,559
@mattphillips.io 🦋 retweeted
With Sandpack 2.0 & Nodebox, we're taking a step forward in improving the development world for students, content creators, open-source maintainers, and more.
🔥 Powerful. Fast. Ready To Use. 🔥
Introducing Sandpack 2.0 and Nodebox, a Node.js runtime for any browser.
📱 Run Node.js in any browser, any device
✨ Vite, Next.js, Astro & more
⚡ Super fast, with a Rust-based transpiler
Here’s why we believe this is HUGE 👇
codesandbox.io/blog/announci…















