profile

notJust.dev Newsletter

🚀 Meet Bun 1.0: The New Cool Kid on the block

Published 8 months ago • 4 min read

notJust.dev Newsletter 🚀

Stay up-to-date with the latest technologies and become a better developer

Hey Reader 👋

I just came back from a short family trip in the Romanian Mountains ⛰️, and was excited to see a lot of new announcements in the Javascript world. In this issue, we will cover:

😎 The new cool kid on the block: Bun 1.0

🙈 API Routes coming to Expo Router V3

💡 An easy trick to get 50 GB of free storage

This issue is sponsored by IBM StepZen

Intimidated by GraphQL? 😱

With IBM StepZen you'll be impressed how easy it is to build GraphQL APIs.

All you have to do is run a CLI command ($ stepzen import), and the rest is done by IBM StepZen. It connects with a wide range of data sources such as SQL databases, Rest APIs, and even other GraphQL APIs.

I've personally used it in multiple projects (Spotify, StackOverflow, LinkedIn) and it saved so much time.

Let IBM StepZen take care of the boring stuff so that you can focus on building impactful apps 🚀

😎 What’s up with Bun 1.0?

Bun 1.0 was released at the beginning of this month, and it got a lot of attention in the Javascript community. Is it just hype, or is it here to revolutionize how we build and deploy Javascript apps?

What is Bun?

Bun is everything you need to build and run Javascript and Typescript applications. It’s the Swiss knife that can do everything: run, build, test, debug, transpile, test, etc. The best part about it is that it’s really fast⚡

The problem Bun is trying to solve is the complex and fragmented toolchain we need nowadays to build javascript/typescript apps. For example, a simple NodeJS app needs:

  • NodeJS to run it
  • npm/yarn to install packages
  • nodemon to watch file changes
  • pm2 to run and monitor in production
  • tsc to transpile Typescript to Javascript
  • Babel to transpile Javascript
  • Esbuild/webpack to bundle the code
  • Jest for testing
  • etc, etc, etc…

All of these tools not only make everything more complicated for developers but also slow down the whole process of developing apps. Everything works independently, and sometimes the same step has to be executed multiple times.

Javascript Runtime

Bun is a drop-in replacement for NodeJS, and it is compatible with “any” NodeJS app. It supports the most popular frameworks like Express, NextJS, Astro, Next.js, etc.

NodeJS is built using Google’s V8 engine that powers Google Chrome.

Bun is built using Apple’s WebKit engine that powers Safari.

It can run Javascript, Typescript, and event JSX/TSX files without any additional dependencies.

Package Manager

Bun is also a package manager like NPM or YARN.

In simple words bun install is a much faster version of npm install.

Test runner

Bun is also a test runner that can replace Jest. It has the same concepts as jest (describe, test, expect), but it runs much faster.

Bun for React Native

How does this affect us - React Native Developers?

When it comes to the runtime, React Native is using Hermes, which is a javascript runtime optimized for mobile. I don’t think there will be any changes to this in the near future.

However, Bun as a package manager is something that we can start using right away and benefit from faster installation and execution times.

Bun for Expo

Expo just announced that they added support for Bun on Expo CLI and EAS. That means that we can create expo apps, install packages, run scripts, and build our app on EAS using Bun.

Try it out by running bun create-expo my-app and see the magic yourself.


🙈 API Routes in Expo Router V3

Evan Bacon, the author of Expo Router, published a new RFC for an exciting new feature that is coming to Expo Router V3: API Routes. This will allow us to build full-stack apps, without leaving our Expo project.

The API Routes will enable developers to safely run server-side logic, without having to manage 2 separate projects for the mobile and the backend. On the server side, you can do everything from interacting with the database, authorizing users’ requests, to safely interacting with 3rd party APIs (e.g. OpenAI) without exposing your private keys.

A simple use case

You are building a simple mobile+web app. You have to integrate Stripe for payments. To process payments, you have to generate a Payment Intent using your Stripe private key. The private keys should never be used inside your client-side code. That’s why this should happen on the server. If you don’t have a server, you would have to setup one, just to integrate with Stripe.

With API Routes, you would simply create an API route, which will technically be a simple file in your Expo project, export a POST function, and safely create the Payment Intent on the server side using your private key.

Inside your Expo app (client side), you will send a post request using fetch to the API Route that you just created.

Everything lives inside your Expo project. Mobile. Web. And now also Server/Backend.

Note: You would still have to deploy these functions, but I am pretty sure that EAS will soon have support to deploy the API routes with one CLI command 🤫

💡 Tip of the day

If you are like me, building lots of JavaScript projects, most probably your drive is full of node_modules folders. I saved over 50 GB on my old machine deleting the node_modules from old projects.

Running npx npkill will find all the node_modules folders and you can select the ones you want to delete.

‼️ Only delete the node_modules folder from the project that you have created. There are also some system applications using node_modules, that you shouldn’t delete. If you have a folder where you keep all your projects, first navigate there and then run the command.

All the information about what packages your project depends on, is kept inside package.json and the next time you need to run the project, you can simply npm install (or bun install 🤔) to install back all the packages.

🔁 In case you missed it

Spotify Clone

Build the Spotify Clone using React Native, GraphQL, and StepZen by integrating directly with Spotify API

Stackoverflow Clone

Improve your React Native skills with this full-stack beginner-friendly tutorial

🔥 Press worthy

👀 Static Hermes: compile Typescript to native code for better performance

🤖 ChatGPT can now see, hear and speak

Did you learn something new today?

If you found this email valuable, forward it to one friend or coworker who can benefit from it as well. That would be much appreciated 🙏

Vadim Savin

Helping you become a better developer together with the notJust.dev team

113 Cherry St 98104-2205, Seattle, WA 98104-2205
Unsubscribe · Preferences

notJust.dev Newsletter

by Vadim Savin

Stay up-to-date with the latest technologies and become a better developer

Read more from notJust.dev Newsletter

notJust.dev Newsletter 🚀 Stay up-to-date with the latest technologies and become a better developer Hey notJust Developers, Exciting news in the world of React Native Animation: The Skia team recently published React Native Skia version 1.0, a significant milestone achieved just 3 weeks ago. In this first-ever stable release, they’ve unveiled 5 super exciting features and enhancements. Rich Text Layouts using the New Paragraph API New Animation Hooks The Atlas API for rendering multiple...

about 1 month ago • 9 min read

notJust.dev Newsletter 🚀 Stay up-to-date with the latest technologies and become a better developer Hey notJust Developers, Last week, I rebuilt the nice Apple Wallet Card animation in React Native using React Native Reanimated and React Native Gesture Handler 🧑💻 In this issue, I want to break down the animation and show what’s possible. I hope this will give you some ideas of interesting animations you can build in your apps. This issue is sponsored by App.js Join us at the 4th edition of...

about 1 month ago • 4 min read

notJust.dev Newsletter 🚀 Stay up-to-date with the latest technologies and become a better developer Hey notJust Developers, A lot of exciting things are happing in the React Native world. But today, I want to focus on 3 things that caught my attention in the last weeks: How React Strict DOM is reinventing cross-platform development The retirement of App Center and CodePush, and what are the alternatives How does the new EU Digital Services Act affect mobile developers Sponsored by IBM StepZen...

about 2 months ago • 3 min read
Share this post