Businesses are increasingly integrating AI into traditional workflows, but the integration of these models can be a clunky process.
This is why
@platformatic
is launching AI-Warp, a unification layer to standardize interactions between your apps & AI service providers.
Are you in trouble hiring software engineers? Hire them in Nigeria. Everyone that is figuring out how to do this will have a massive advantage in the talent war.
fetch() has shipped in Node and now people are complaining that it does not work like node-fetch 🤦♂️. However, EVERYBODY said they wanted more standard-compliant APIs from Node.js.
I'm stunned by how simple my
@nodejs
http client 'Undici' has become. It's also twice as fast of the old 'http' module in core. It's stable, and you should use it right now.
We are cooking something new for
@nodejs
v18. It has been a long time in the making (!) and I’m really super excited about it.
Hint: you have been all asking for this for years.
If you are the CEO of a company and you complain that
@nodejs
(or any other Open Source project) is lacking a certain feature, you are implicitly saying that you do not want to allocate any budget to the maintenance of a key piece of the platform you rely on. You should do better
The recommendation I give everybody starting up in tech is: read the source.
Are you using a library that you like? Read it.
Have you got a bug you can’t solve? Read the source of the dependencies.
Somebody is pitching a framework as magical? Read it.
No matter what, read code.
TypeScript is growing a bit in me, I find it great satisfaction when everything is typed. However, how do you justify spending an afternoon to get a type right, while you can slap an any on it?
I’m quite surprised a significant part of the industry does not write automated tests or find them useful. They are a fundamental design tool for me and I almost can’t code without.
Do you write tests?
According to the State of JavaScript,
@fastifyjs
is the
@nodejs
backend framework with higher developer satisfaction. I'm extremely proud of what we achieved as a team.
> What have you done this week?
I made
@nodejs
HTTP server almost 20% faster.
(I’m omitting the fact that the 20% was actually there before and we lost it between v14 and v16-pre).
Anyway, I’m proud 🎉🎉🎉
I'm not always excited by a new minor release of
@nodejs
. This time I am and you should too!
Node.js v18.11.0 ships quite a few new features. Let's unpack them.
Quite a few people have asked me what HTTP client I recommend for Node.js.
In concert with my frriend
@ArrowoodTech
, we have prepared a benchmark for you to decide.
.
@nodejs
is fast and easy to use. The fact that your JavaScript libraries are either 1) buggy 2) slow is not a problem of JavaScript. Simply put, those libraries are not well written.
Rewriting everything in another language is unlikely to solve either problems.
@jessfraz
A few reasons:
1. Node.js has no budget of its own, and npm is maintained by a tiny team. Most of the investment being made are in adding capabilities or things more secure, not making things faster. (Making things faster does not make anyone more money, it’s abit of tragedy of…
.
@v8js
surprised me again today! I've received a casual PR to one of my modules. The pattern I have been using to instantiate new objects in JS could be drastically improved. is a thing and it's incredibly fast.
Most teams do not know how to manage a
@nodejs
application at scale regarding memory. Here is a simple fact: V8 GC will consume all memory that it has available. Configure a memory limit and do not recycle your instance if it hits 80% of memory usage - it's totally normal.
Yesterday in my stream I was asked why I'm not using jest to test Node.js applications. Here is the quick explanation: an Error is not an instance of Error.
Big life update! Today is my last day as
@NearForm
Chief Software Architect. NearForm is the best professional services company in the world and an amazing place to work at.
To whom it may concern: if you complain that Node.js is slow and you have not invested a dime in improving it…. hear this:
Node.js is built by volunteers. Bugs don’t get magically fixed, as much as money does not grow on trees. Invest in the commons.
.
@deno_land
is now supporting npm. I’m really glad they had a massive change-of-heart regarding npm and
@nodejs
.
I’m thrilled! This means all the stuff I built is now available there too! We should get
@fastifyjs
supported soon.
I'm proud to announce that
@platformatic
first tool is now Open Source: Platformatic DB! It creates REST and GraphQL APIs from your database schemas, keeping it customizable via
@fastifyjs
plugins.
A lot of folks consider Node.js a product. It’s not. It’s an OSS community that maintains a JS runtime. If you want something to happen, come and contribute.
One of the fundamental principles of OSS is that *you* are the last maintainer of all OSS you use. This means that if your OSS dependencies fail, you should be ready to take over. Today there are very few companies in the world that can afford that. Therefore it’s in your best…
Unpopular opinion: one is doing nothing wrong when using Free and Open Source software in full compliance with the license, never asking for more than what was voluntarily given, and never "giving back".
Even if this competes with the original authors in marketplaces.
The key reason fetch() is not happening in
@nodejs
is that it is a gargantuan amount of work that no company is willing to sponsor.
node-fetch does 80% of what’s needed and it is extremely easy to install.
Using a dependency built with Typescript completely disrupt my flow. When it's JS, I can quickly jump in inside node_modules, make a few modifications and tests my theories. Most TS projects don't ship their sources, so doing these "quick hacks" is not possible.
Today I’m thinking that as the JavaScript community we should have done better. There are *so many JS developers* out there that do not have a basic understanding of how promises work. Sigh.
Do you know any confs that would like to have us delivering a workshop on the topic?
Unpopular (?) opinion: Object-Relational-Mapping create more problems than what they solve. They help you in the 80% part that's easy, and slow you down in the 20% part that is actually hard (where you are going to spend 80% of the time anyway).
Wow! AWS released their own JS runtime! The devil is in the details, and this is only tailored to be a runtime for Lambda. I’ll definitely tinker with it!
Instead, why didn’t work to optimize
Node.js and contribute back?
I *really* like what
@jarredsumner
is doing with Bun, but I'm a bit frustrated by their compatibility claim with
@nodejs
. It's not fully compatible, and many inner details are different. This results in many random issues over my repos asking for fixes for Bun incompatibilities,…
I just did a quick benchmark of crypto.randomUUID() vs the uuid module on Node v16. 17 millions ids/sec vs 2 millions ids/sec.
TL;DR migrate to Node.js v16 and use crypto.randomUUID().
Congrats
@jasnell
for building and shipping this!
The event loop is core to Node.js performance, but things can go wrong.
In this article, we took a look at the event loop, its importance and utilization, best practices & the math behind synchronous response processing.
I'm not capable of learning a programming language (or framework) from ground up. I need to built something with it and this normally means skipping through a lot of "fundamentals" which I would fill at a later time.
The best recommendation that I can give to a junior engineer: read the source. Docs could be out-of-date, or misleading. If you think there is a bug in a dependency, check the code. You will be in the best position to fix it. Learn to read code.
I can’t understand why so many devs like ORMs (or ODMs) so much. DBs are so powerful and can do so many amazing things.. why would you decide to not leverage them at their best?
Devs: we want the safety of TypeScript
TS: every minor might include breaking change
DefinitelyTyped: every release might include breaking changes
Module authors: it's okay to ship breaking changes to types in minor releases
Developers: your minor update broke our build!
Today has been an emotional intense day. Tomorrow will be worse. To recover I’m at home coding something just for fun - as you taught me, Dad. Godspeed, and see you on the other side.
Here is my recommendation to all my fellow npm module authors: don’t drop support for CJS and go esm-only. The community is not ready to migrate just yet.
One more fantastic day in Open Source land.
User: "I have this very important bug that I need fixed yesterday"
Me: "Would you like to send a pull request to fix it?"
User: "No, I do not have the time".
...
Do you think it would be fair to ask if they were willing to pay?
Fun facts about IP networking and
@nodejs
: most people believe localhost 🏡 is one IP address.
localhost usually resolves to TWO addresses, 127.0.0.1 (IPv4) and ::1 (IPv6). The order in which those are resolved is dependent on the operating system. These days ::1 comes first.
Dev on GitHub:
> i can't use this library anymore because of such little thing.
Me:
> Would you like to send a Pull Request to address this issue? Remember to add unit tests.
🐢🚀 The redesigned is live!
- Fresh look
- Comprehensive search
- New learning resources
- APIs & downloads unchanged
- Improved contributor DX
Stay tuned for more details in upcoming posts. Explore, share, and give us your feedback!
Prisma is the most interesting thing in database access happening in the Node.js space. I’m usually against ORMs but I recommend you to check this out and evaluate.
The dominance of Mac and Linux in the developer market makes it EXCEPTIONALLY HARD to support Windows users. I'm not sure how could we still be inclusive (windows machines are cheaper) and at the same time keep innovating our libs.
I'm stunned by the performance of node:test on Node.js v20.
A simple test takes 15ms to run on my machine. The same equivalent test takes 20ms to run on tap and 202ms to run on vitest.
One of the simplest principles of software development is
> Things that should change together should be together
For example, this means that your routes should be defined in the same file as your handler, and your validations/schema should be there too.
One of the things of upgrading your
@nodejs
runtime is that it gets faster. v12.11.0 can provide around 20% more throughput when serving http requests compared to v10.16.0. Good news v12 is going LTS next month!
Should I start a weekly coding twitch? Have you got any recommendations for setting it up? *Really* thinking about it, I want to show I’m coding
@nodejs
,
@fastifyjs
&
@platformatic
in the open.
If you use Node, this blog is for you! We took a look at:
‣ General best practices
‣ Module management
‣ Dependency injections
‣ The drawbacks of singletons for holding state variables