Skip to content

v0.3.0

Compare
Choose a tag to compare
@akirarika akirarika released this 29 May 15:37

0.3.0 - Amusement Park

"It's simple, just imagine the ice cream in my hand," Alice said while licking her ice cream, "but... it gets very tiring after a while, and I'll fall asleep right away. And it only works for things I remember in detail. When I tried to escape, I wanted to create a hat to cover my face, but instead, I created a snake that swallowed an elephant. Scary."

Brand New Creation Tool

Now, Milkio offers a tool to help you create new projects easily.

bun create milkio

By running the command and answering a series of questions, you can get a brand new Milkio project.

Windows Support

Bun has officially completed support for the Windows platform. After a series of adjustments, Milkio now supports the Windows platform as well.

Support for Stream API (Server-Sent Events)

Documentation: Stream

Now Milkio supports sending API responses in a streaming manner. This will be useful when your application includes chatting with a large language model or when you need real-time notifications when someone comments on your blog.

export const api = defineApi({
	meta: {},
	action: async function* (params: undefined, context) {
		yield "hello";
		yield "world";
	},
});

Client Package Now Based on Fetch

The client package now defaults to using Fetch. Previously, you had to manually tell the client package how to send requests and how to store data through the handler:

import { createClient } from "client";

export const client = createClient({
  baseUrl: "http://localhost:9000/",
  storage: localStorage,
  async handler(url, body, headers) {
    return await (await fetch(url, { method: "POST", body, headers })).text();
  },
});

Now, by default, the client package will use Fetch to send requests and localStorage to store data.

import { createClient } from "client";

export const client = createClient({
  baseUrl: "http://localhost:9000/",
});

In some environments, you might be missing some required objects. You can provide polyfills for storage, fetch, and abort in the options. For storage, it even supports asynchronous operations.

Static Server

Documentation: Static

Milkio now supports a static server, which means you can deploy the static assets packaged by the frontend with Milkio.

VS Code Menubar

Documentation: VS Code Menubar

Now, you can freely configure the VS Code menubar for Milkio. You can place your frequently used scripts in the menubar, so you don't have to manually enter commands and can call them quickly.

Drizzle

Documentation: Drizzle

Now, Drizzle is Milkio's preferred ORM. It is the only ORM that has both a relational query API and a SQL-like query API, providing a comprehensive service when accessing relational data.

Although Drizzle might be a bit cumbersome to use, Milkio provides a series of features to simplify the use of Drizzle. The documentation for Milkio's Drizzle is written from the perspective of someone with zero SQL knowledge, allowing even those without SQL experience to quickly get started through the documentation.

Optimizing Generate Phase Performance

In the past, the generate phase would load TypeScript files to obtain information about the API. Now, it has been changed to directly analyze the TypeScript files as strings.