PSA for zod v4 users, esp on Lambda, Vercel, CF Workers, etc with a bundler: import * as z from “zod”; // ✅ 68kb import { z } from “zod”; // ❌ 244kb
30
75
1,190
130,021
If you're ever feeling down about your code, keep your chin up: I just noticed the AWS SDK has had this for six years 😬 (you can't compare arrays like this in JS)
21
117
655
Made Next.js fast. Er. • Bun: 1.15x faster • Node.js: 1.18x faster • CF Workers: 1.24x faster • Deno: 1.38x faster 🚀
Replying to @hichaelmart
I've made a PR to optimize some of that work. It currently creates 1745 ReadableStreams per request unnecessarily 😬 This fix eliminates that and you get a 10-38% perf boost (Deno users get the most!) github.com/vercel/next.js/pu…
13
12
421
80,339
What makes Next.js slow? In cases like @theo's benchmark, it's because it's creating multiple React streams, parsing and rendering to JSON and HTML, reading the whole body along the way and doubling the payload. Next.js = 220ms, plain React streams the same thing in 27ms
15
15
300
75,007
One of the biggest engineering costs you can reduce is developer-thumb-twiddling. Brought our frontend CI time down from 8 mins to 25 secs by parallelizing on AWS Lambda (@lamb_ci). Each Lambda tests every nth file (testing/formatting/linting 3k files over 13 sites).
14
56
284
A bunch of ppl have asked me to explain this Next.js performance issue. Settle in for a tale of laziness, batching and doing too much work. ☕️🧵
So I just discovered a 68% performance boost to Next.js and it all comes back to this (I dunno if they'll go for it though 😬)
13
21
283
102,522
So I just discovered a 68% performance boost to Next.js and it all comes back to this (I dunno if they'll go for it though 😬)
Replying to @hichaelmart @theo
This is what it might look like in a profile (though you’ll probably be looking at a minified version of this)
8
9
261
193,140
Wait wait, I meant a 91% boost
So I just discovered a 68% performance boost to Next.js and it all comes back to this (I dunno if they'll go for it though 😬)
8
4
220
47,100
Oh, hey there 👋. Just had a lovely 5 mth break 🐨☀️, what'd I miss? No big changes I should know about? Well good, I'm back in NYC and happy to announce I've just started a new job at @Cloudflare as a Principal Engineer on the Workers team 🎉
11
7
160
AWS us-east-1 went out with a bang 💥
6
16
136
Effect is giving RxJS, Co, etc vibes? Great for one-man-bands but it’s a whole DSL. Unreadable to newcomers. Just a mess for hiring, teams changing, contributions, anyone new coming to the codebase. Tell me how this time it’s different?
19
3
139
43,400
Got Hono working with MCP's new StreamableHTTPServerTransport. Deploy to anywhere! github.com/mhart/mcp-hono-st…
5
10
127
11,965
Announcing LambCI, an open-source continuous integration tool built on AWS Lambda: medium.com/@hichaelmart/lamb… 🐑
3
74
120
Excited to open up the thing I've been building for the last 6+ months 🚀 No need to specify a region, it automatically figures out the nearest *datacenter* to your backend based on RTTs we have from millions of origins. Perfect for multiple round-trips to databases and APIs.
4
20
123
43,556
Damnnn, training BERT in under 25 secs 😲 cloud.google.com/blog/produc…
6
20
117
AWS Lambda blows my mind every time I flex it. Currently executing 2000 parallel 15min functions doing a hyperparameter seach with fasttext. 🤯 Would take me frikken hours to do this any other way.
3
20
105
Very excited to announce that all docker-lambda runtimes now support warm invokes – speed up that local testing! And 35.3 million downloads 😳, well done ppl 🙌 medium.com/@hichaelmart/stay…
1
19
101
Replying to @ben11kehoe
Omg I just saw this and rushed to your profile. Can't believe you single-handendly convinced the entire org to get acquired just so you can make IAM at AWS even better.
1
84
Have wanted this ever since DynamoDB launched – this is great!
9
8
92
End of an era. There goes my one weird trick. hichaelmart.medium.com/shave…
NEW: AWS Lambda will now begin billing for the INIT phase for all runtimes (not just custom/container runtimes). Your cold starts cost money now!
5
11
95
20,231
Oh man, so many awesome launches today that I was lucky to be part of. Here's just a few: - Workers AI (including embeddings models!) - Vectorize (no need to leave CF to build RAG apps) - AI Gateway (manage all your LLMs in one place) blog.cloudflare.com/workers-…
7
9
93
24,756
One of the many reasons why throwing for control flow is not a good idea folks. github.com/v8/v8/blob/1ef70f…
5
7
84
12,416
For all you minimalists out there – just created some tiny Docker containers for Node.js/io.js (7.5MB compressed!) registry.hub.docker.com/u/mh…
4
40
77
Want to develop for Lambda Container Support with standard docker commands and tiny images like Alpine? I've written a post! With code. I also highlight how you can use Go handlers directly as entrypoints hichaelmart.medium.com/using…
2
18
73
Some weekend serverless mad science – got self-hosted Github Actions running on Lambda ⚗️🐑 Hello concurrency!
5
6
70
Just shared my entire AWS credentials file on Twitch, AMA. (yes yes, I've since made all the access keys inactive 😅)
11
67
Spoiler: for the problems I list, it's not. Any CTO or VP Eng who's tackled hiring or scaling JS teams over the years will tell you the same. You're taking on a fundamentally different runtime, return types, and control flow from idiomatic JS. You're taking on A LOT. However...
Effect is giving RxJS, Co, etc vibes? Great for one-man-bands but it’s a whole DSL. Unreadable to newcomers. Just a mess for hiring, teams changing, contributions, anyone new coming to the codebase. Tell me how this time it’s different?
3
2
72
19,603
Replying to @TooTallNate
fs.readFileSync(‘/dev/stdin’) 😉
2
10
67
Official Node.js v10.x runtime support on AWS Lambda! aws.amazon.com/about-aws/wha… Supported on docker-lambda too (and AWS SAM CLI). Many interesting things about this release, strap in:
1
31
63
Hi Leon Hartovic (oh yes we did)! 🦁❤️ Born 4th Dec - after giving mum hell for 37 hours 😳 At 3.3kg and 51cm, he’s going to single-handedly convert the US to metric 🤓
7
1
61
All of the issues I raised last month about the AWS Lambda nodejs10.x runtime have been addressed – kudos to the AWS team! I go through how they addressed these issues (and some new potential gotchas) here: medium.com/@hichaelmart/aws-…
2
19
61
AWS SAM CLI went v1.0.0 today. It no longer uses my images – the docker-lambda bootstrapping code has been copied into the SAM repo. I have... many feelings about this, and the last three years. But that's for another day. For now, go check it out! aws.amazon.com/blogs/compute…
4
10
61
One very interesting thing about the new custom runtime support in AWS Lambda is the model it uses: instead of starting a local server (like the Golang runtime does), you poll a local HTTP endpoint for new events – similar to how you would w/ SQS.
2
14
57
More preInvent goodness from the SDK feeds – this sounds really useful 🎉
4
3
56
Woah, how did I miss this? @stackblitz has an open source run-your-own bolt called @bolt_diy – and it runs on Cloudflare Pages! AND you can run whatever model you want! Whaaat!?
3
7
57
7,247
Replying to @hichaelmart @theo
This is what it might look like in a profile (though you’ll probably be looking at a minified version of this)
2
59
71,335
AWS keeps calling Fargate "serverless" and it really irks me. 1. you have to configure a cluster. 2. It doesn't auto-scale out of the box, you have to configure a load balancer, an auto-scaling group, decide on policies, and it won't go to zero. I mean, come on.
Today at AWS re:Invent 2019 we announced AWS Fargate Spot. This has been a huge ask from customers. Enjoy those up to 70% savings on your managed serverless containers with Fargate Spot!! aws.amazon.com/blogs/aws/aws… #SaveAtScale #Spot #Fargate #awsreinvent
5
11
50
Tackling this, one of my main takeaways is that HTML rendering via RSC still feels pretty early. There's a lot more to be done to get Next.js times down to regular React levels. And that's that! If you've made it this far, thanks for coming on this journey 🙏 #themoreyouknow 🌅
1
1
49
2,550
Real talk though: I created docker-lambda four years ago to fill a fidelity gap in the Lambda landscape. Same with yumda a year ago. The features AWS released today (for my birthday, thanks y'all!) make both of those projects redundant, and I couldn't be happier 🎉
Want to develop for Lambda Container Support with standard docker commands and tiny images like Alpine? I've written a post! With code. I also highlight how you can use Go handlers directly as entrypoints hichaelmart.medium.com/using…
9
44
HTMLRewriter is actually great for PPR (Partial Prerendering). Here's a framework-free example on CF Pages.
2
7
47
5,952
Grab a sneak peak of GitHub Actions running on Lambda in my re:Invent dev chat which is now live. Things have been a little chaotic recently (thanks us-east-1), so the project's not quite ready for public consumption. But soon! 🤞 virtual.awsevents.com/media/…
3
7
44
Replying to @jarredsumner
I mean.
2
44
3,651
This is ridiculous. You lose the ability to do joins for one thing. The correct way is alternating rows, shard the row using hash of primary key % 2 == 0 for Postgres, 1 for MySQL.
people do not do high availability correctly the right approach is to split your schema and put half the tables in postgres and the other half in mysql
3
45
4,543
Why I'm excited for Hyperdrive in three words: Serverless Connection Pooling
Want to make the existing regional database in your legacy cloud provider much, much faster? We've just launched Hyperdrive, which dramatically speeds up queries you make to databases you already have from Cloudflare Workers. blog.cloudflare.com/hyperdri… #BirthdayWeek
1
3
42
5,852
Ever wondered what code's ACTUALLY running on the Lambda runtime to marshall your responses back and forth? You shouldn't *have* to know this. But just in case you did... it's now open source! github.com/aws/aws-lambda-ru…
3
6
37
After 4 years and 10 acquisitions and launches (!) I'm moving on from the fine folks at BDG! 🎉+😭 Gonna finally see family and friends in Aus, hang for the (🐨) summer, and then embark on something new. But what? You tell me!
13
1
38
Replying to @rvagg
But a code of conduct is there to make it clear what is acceptable and what isn't – ESPECIALLY for ppl who have trouble with social norms.
3
2
31
Bout to jump on a plane back to NYC from @aiDotEngineer in SF. Think @swyx put on a great conf that was surprisingly (to me) light on BS. Was expecting more Web3 vibe but it was very much smart ppl hacking on real problems. No one’s got the answers yet, the space is super early.
3
2
42
7,356
Yes... I'm talking about you ReactFlightClient. github.com/facebook/react/bl…
2
3
42
38,697
Shift-Cmd-P -> MCP: Add server -> HTTP -> docs.mcp.cloudflare.com/mcp -> Enter -> Rename to cloudflare-docs -> Profit!
💯 v1.100 of @code is here! And we’ve got some great updates for you, like: - Smarter chat responses with new tools - Improved multi-window support - Image and Streamable HTTP support for MCP servers …and so much more. aka.ms/VSCodeRelease Here are some of the highlights… 🧵
4
3
42
5,696
Still can't help themselves. Let's show photos of a dozen ppl outside right above the text that shows it's got nothing to do with where they *actually* found the cases cc/ @zeynep
2
5
34
$0.50/million requests is... impressive! Now open to everyone, the serverless space continues to balloon! blog.cloudflare.com/cloudfla…
3
7
37
Look, AWS, your tech is amazing, but your tutorials... man, WTF is all this? aws.amazon.com/blogs/compute…
8
8
33
Absolutely nails it. (At 10:03 in the video).
Durable Objects by @Cloudflare have changed the way I design full-stack services. This video explains why: piped.video/watch?v=qF2PuYnB…
6
38
3,645
This is a pretty impressive step from AWS, showing how seriously they dogfood – SAR is built internally on serverless, and today they're opening it up for all to see. Not just diagrams with icons this time, but actual code (w/ deploy/CI) 👀
New open source project based on Amazon’s approach to building #serverless apps, with key architectural components, code structure, deployment & testing, & ops practices of the AWS Serverless Application Repo. amzn.to/2MIAjlN @usamanaseem @salman_paracha @arungupta
1
6
35
If you listened to Part 2 of my interview with @jeremy_daly, I mentioned this `yumda` project I'd been working on – yum for Lambda. Well I finally got around to releasing it! 🎉 Check it out: github.com/lambci/yumda
Episode #19: Pushing the Limits of Lambda with Michael Hart (@hichaelmart) *PART 2* is now available! #serverless serverlesschats.com/19
2
14
35
Genius... or madness?
5
1
38
10,052
Suuuuper excited that @ZeeJab is officially VP of Engineering at @bustle digital group! Well deserved after many years of creating an awesome team. Just don't let @tomdale know she hasn't updated her LinkedIn profile yet 😱
5
1
30
Ok, so Azure Functions are an *entirely* different beast to AWS Lambda. All function invocations share the same resources! No scale at all.
4
30
32
Oh man, so excited about this. Baselime’s such a killer product, I can’t wait to give these tracing and telemetry super powers to everyone 📈 blog.cloudflare.com/cloudfla…
1
34
2,081
AWS CLI v2 is GA – some sweet features in this aws.amazon.com/blogs/develop…
1
13
33
Replying to @thdxr
"factually erroneous" going all tautology on their ass
1
35
1,574
Hell yeah, @CloudflareDev open source ftw
1
34
2,802
You write one blog post criticizing a runtime... 😆
1
4
35
Let's just say I know someone who worked on this (me, it's me) Making multiple round trips to a backend? You wanna run close to it! Sign up to our private beta to try it out and let me know how it goes 🚀
Running Workers that connect with databases, self-hosted resources, third party APIs? Sign up here bit.ly/401FFMO to get access to Smart Placement (beta), our new feature that automatically moves Workers to an optimal location to help speed up your applications!
1
6
32
9,898
So literally the second it ticks over to my birthday, I'm giving a talk at AWS re:Invent 🎉 Which I've never been to. Because it always falls on my birthday. Tune in to see a sneak peak of GitHub Actions running on Lambda with @lamb_ci! 👀🐑 virtual.awsevents.com/agenda
4
4
33
So official rust and C++ support in Lambda is awesome, but if you want to try a fast compiled language with less ceremony, check out @nim_lang – 250kb binaries, cold start in ms! github.com/lambci/awslambda.…
1
11
30
😳 The graham cracker was designed to be deliberately bland to stop teenagers masturbating... And so was Kellogg's!
2
23
32
This throw happens 9,482 times in @theo’s Next.js benchmark btw (not the react ssr one, for two reasons: 1) it calls the legacy renderToString and 2) even if it did call renderToReadableStream it’s just rendering, not replaying like Next.js does)
1
1
34
6,907
I've long been against writing my code in .TS due to the compilation step. Have always advocated for JS+JSDoc for typing. However. Now that you *can* just run TS with Node directly, I'm all for it. Just stick to the erasable syntax and you're golden. ✨
TypeScript 5.8 ships erasableSyntaxOnly mode 🎉 It matches Node's built-in TypeScript support, guiding users away from... TS-only runtime features ❌ enum ❌ namespace ❌ parameter properties ❌ import x = Legacy type features ❌ <> type assertions Remember: TS = JS + Types
2
2
31
4,531
Super impressive numbers too (aw, poor Node.js – it's kinda been left for dust these days 😞)
3
20
29
Remember when we used to post pictures of homemade sourdough, and then it went out of fashion? BREAD’S BACK BABY.
2
28
3,299
If it is to be said. If it is to be said, so it is. I merely wish to answer in the affirmative fashion.
2
7
25
“Time to dopamine: seconds” – @ritakozlov nailing the @Cloudflare Workers experience at @SlsDaysNYC – with not one, but TWO live demos to boot 🔥
4
29
Aw, baby's first patent. Lucky to share it with the likes of @KentonVarda and @Aly_Cabral!
3
28
1,747
We listen to our users. So I'm excited to announce, next innovation week, we're making the Cloudflare developer platform illegal! 🎉🎉🎉 (nailed it, I'm defo getting a high five in the kudos channel for this)
My AI app supermemory.dhr.wtf runs for 5$/month using all the modern architecture - everything on the edge, low latency, queuing, caching, etc. it should be illegal to use cloudflare
2
30
6,297
AWS CDK 1.23.0 is out and it introduces a high level construct for Node.js (including bundling with Parcel). At first glance this feels better than ‘sam build’. Fascinated to see how the two play out going forward
3
3
28
Your daily reminder that "anti-patterns" would usually be better rephrased as "things to consider". aws.amazon.com/blogs/compute…
1
30
All of the examples in the zod docs now use this – so newcomers should be fine. Just existing users that might not be aware. zod.dev/
3
1
30
10,411
Roundtrips around the world to a regional backend are slow. But the platform should just solve this for you by moving your workload – esp when it can see where your backend is. Eg, with Smart Placement developers.cloudflare.com/wo…
We’ve run the experiment. Edge rendering doesn’t work: it’s slower, has worse DX & runtime limits. We reverted it. Edge as in network is still critical for the static bits, like JS assets and PPR. The rest server-renders and streams from the cloud region. nitter.app/leeerob/status/1…
1
26
5,797
Wow, can't tell if it's the great job of the @nytimes moderators, or the beautiful prose of @sstefanovic (obv the latter), but I have to say something I haven't said in years: read the comments! nytimes.com/2018/04/07/opini…
4
23
If you're using Provisioned Concurrency with your Node.js Lambda, you might find doing work at init time is a bit tricky. I just published a package, sync-threads, to make that easier for you. But check the README, you might not need it! github.com/lambci/sync-threa…
I actually explored this at the time, and wrote a pattern that uses worker threads and shared memory mutexes instead. Never got around to publishing it, but you've convinced me 😉 github.com/lambci/sync-threa…
1
6
27
Great new launch from AWS. Under the hood it's based on nginx' njs. Gonna be interesting to see how this is received: on the one hand, it's awesome to have a *very* low overhead runtime. On the other, it might not be compatible with all the code out there assuming v8/Node.js
New! Introducing CloudFront Functions 👉 Run Your Code at the Edge with Low Latency at Any Scale ✍️ buff.ly/3gY8Nl7 #AWS #CDN #Serverless #JavaScript
4
7
22
45 million docker-lambda downloaders disagree 😉 (178k pulls daily and counting). Btw, you can totally pass through IAM credentials to your local invocations. Use the same roles as you would if you were live testing 👍
6
1
27
So for any docker-lambda, `sam local invoke`, `serverless invoke local`, `stackery local invoke`, etc fans out there – I'll be pushing up some changes in the next week to support keeping containers warm 🎉 github.com/awslabs/aws-sam-c…
3
9
25
Aw, thanks to the brilliant Lambda team for this – given the awesome features you brought in a very tough 2020, can’t wait to see what you smart kids come up with in 2021! 🙏 @trishika_p @david_nasi @dhruvsood @ajaynairthinks
25
esbuild by @evanwallace is *crazy* fast. Our builds went from 1m20s with webpack to 3s (!). Now that I'm addicted, I've created a `ts-node`-like utility that uses it too, called ts-eager. Much faster than ts-node, esp for large jobs like running tests. github.com/mhart/ts-eager
1
6
27
Nim 1.0 has been released! nim-lang.org//blog/2019/09/2… You can run it on AWS Lambda using github.com/lambci/awslambda.… (it's literally the fastest runtime I've seen)
1
6
23
A summary of the Kinesis event that caused chaos on us-east-1 the other day. Interesting stuff here. Might've just been a ulimit setting? The first alarm firing at 5:15 PST lines up to the minute with when we first saw duplicate log entries in CloudWatch aws.amazon.com/message/11201…
1
7
27
Really impressed with @stackblitz here – it's such an immediate way to get your hands dirty and play with the product. Just modify the example on the fly and you can directly see what it does. Easiest way to answer any dev's "so, what is Workers?" question for sure.
We’re excited to announce that we’re partnering with StackBlitz. Together, we will bring the Wrangler experience closer to you – directly to your browser, with no dependencies required! cfl.re/3slINoN #PlatformWeek
1
5
26