Skip to main content

v0.0.71

Summary

This release introduces support for writing custom serverless functions in TypeScript.

Developers can now define query and update functions using defineQuery and defineUpdate, with input and output shapes described via a type system built on top of Zod. The pipeline takes care of the rest - generating all the necessary types and bindings under the hood.

import { defineUpdate } from "@junobuild/functions";
import { j } from "@junobuild/schema";

const Schema = j.strictObject({
  name: j.string(),
  id: j.principal()
});

export const helloWorld = defineUpdate({
  args: Schema,
  returns: Schema,
  handler: async ({ args }) => {
    // Your logic here
    return args;
  }
});

Both type-safe at build time and validated at runtime, functions support synchronous and asynchronous handlers.

A frontend API is also automatically generated, so developers can call their functions directly from the client:

import { functions } from "../declarations/satellite/satellite.api.ts";

await functions.helloWorld({ name: "World", id: Principal.anonymous() });

Overview

ModuleVersionBreaking changes
Sputnikv0.3.1⚠️️ ️

[!NOTE] Sputnik is tagged as "breaking changes" but contain no fundamental API changes. The version is primarily bumped for traceability reasons only.

CratesVersionBreaking changes
junobuild-auth0.3.2
junobuild-cdn0.6.1
junobuild-collections0.4.1
junobuild-macros0.3.1
junobuild-satellite0.5.1
junobuild-shared0.7.1
junobuild-storage0.6.1️️️
junobuild-utils0.3.0️️️
LibraryVersionBreaking changes
@junobuild/adminv4.2.0
@junobuild/analyticsv0.2.11
@junobuild/authv4.0.0
@junobuild/cdnv2.3.0
@junobuild/cli-toolsv0.12.2⚠️
@junobuild/configv2.14.1
@junobuild/config-loaderv0.4.8
@junobuild/corev5.2.1
@junobuild/core-standalonev5.2.1
@junobuild/did-tools---⚠️ Deprecated by @junobuild/functions-tools
@junobuild/errorsv0.2.3
@junobuild/functionsv0.7.1
@junobuild/functions-toolsv0.5.2🆕
@junobuild/ic-clientv8.0.1
@junobuild/storagev2.3.0
@junobuild/utilsv0.3.0
@junobuild/schemav1.1.0🆕
CLIVersionBreaking changes
@junobuild/cliv0.14.0
PluginsVersionBreaking changes
@junobuild/vite-pluginv4.7.1
@junobuild/nextjs-pluginv4.7.1
DockerVersionBreaking changes
@junobuild/skylabv0.6.3
@junobuild/satellitev0.6.3
@junobuild/consolev0.6.3
GitHub ActionVersionBreaking changes
junobuild/juno-actionv0.6.6

Serverless Functions

You can upgrade your Rust Serverless Functions using the following crates:

[dependencies]
candid = "0.10.20"
ic-cdk = "0.19.0"
ic-cdk-macros = "0.19.0"
serde = "1.0.225"
serde_cbor = "0.11.2"
junobuild-satellite = "0.5.1"
junobuild-macros = "0.3.1"
junobuild-utils = "0.3.0"

What's Changed

Full Changelog: https://github.com/junobuild/juno/compare/v0.0.70...v0.0.71