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
| Module | Version | Breaking changes |
|---|---|---|
| Sputnik | v0.3.1 | ⚠️️ ️ |
[!NOTE] Sputnik is tagged as "breaking changes" but contain no fundamental API changes. The version is primarily bumped for traceability reasons only.
| Crates | Version | Breaking changes |
|---|---|---|
junobuild-auth | 0.3.2 | |
junobuild-cdn | 0.6.1 | |
junobuild-collections | 0.4.1 | |
junobuild-macros | 0.3.1 | |
junobuild-satellite | 0.5.1 | |
junobuild-shared | 0.7.1 | |
junobuild-storage | 0.6.1 | ️️️ |
junobuild-utils | 0.3.0 | ️️️ |
| Library | Version | Breaking changes |
|---|---|---|
@junobuild/admin | v4.2.0 | ️ |
@junobuild/analytics | v0.2.11 | |
@junobuild/auth | v4.0.0 | |
@junobuild/cdn | v2.3.0 | |
@junobuild/cli-tools | v0.12.2 | ⚠️ |
@junobuild/config | v2.14.1 | |
@junobuild/config-loader | v0.4.8 | |
@junobuild/core | v5.2.1 | |
@junobuild/core-standalone | v5.2.1 | |
@junobuild/did-tools | --- | ⚠️ Deprecated by @junobuild/functions-tools |
@junobuild/errors | v0.2.3 | |
@junobuild/functions | v0.7.1 | |
@junobuild/functions-tools | v0.5.2 | 🆕 |
@junobuild/ic-client | v8.0.1 | ️ |
@junobuild/storage | v2.3.0 | |
@junobuild/utils | v0.3.0 | |
@junobuild/schema | v1.1.0 | 🆕 |
| CLI | Version | Breaking changes |
|---|---|---|
@junobuild/cli | v0.14.0 |
| Plugins | Version | Breaking changes |
|---|---|---|
@junobuild/vite-plugin | v4.7.1 | |
@junobuild/nextjs-plugin | v4.7.1 |
| Docker | Version | Breaking changes |
|---|---|---|
@junobuild/skylab | v0.6.3 | |
@junobuild/satellite | v0.6.3 | |
@junobuild/console | v0.6.3 |
| GitHub Action | Version | Breaking changes |
|---|---|---|
junobuild/juno-action | v0.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
- style(frontend): align first column in cards on overview by @peterpeterparker in https://github.com/junobuild/juno/pull/2633
- feat(sputnik): migrate usage of spawn_017_compat to spawn by @peterpeterparker in https://github.com/junobuild/juno/pull/2637
- feat(satellite): withs pattern for rules by @peterpeterparker in https://github.com/junobuild/juno/pull/2640
- feat(macros): migrate usage of spawn_017_compat to spawn by @peterpeterparker in https://github.com/junobuild/juno/pull/2638
- feat(satellite): keep system collection upgrades by @peterpeterparker in https://github.com/junobuild/juno/pull/2639
- feat(satellite): use an impl to init rule from setrule by @peterpeterparker in https://github.com/junobuild/juno/pull/2641
- feat(frontend): Update Passkey AAGUIDs by @github-actions[bot] in https://github.com/junobuild/juno/pull/2642
- feat(frontend): assert response ok by @peterpeterparker in https://github.com/junobuild/juno/pull/2644
- refactor(macros): move parser in a sub-module hooks by @peterpeterparker in https://github.com/junobuild/juno/pull/2646
- feat(utils): serde with serializer and deserializer by @peterpeterparker in https://github.com/junobuild/juno/pull/2645
- feat(sputnik): support for including custom endpoints rust module by @peterpeterparker in https://github.com/junobuild/juno/pull/2635
- feat(macros): derive data for custom functions in Sputnik by @peterpeterparker in https://github.com/junobuild/juno/pull/2647
- feat(utils): keep but duplicate/rename doc data to json data by @peterpeterparker in https://github.com/junobuild/juno/pull/2648
- feat(macros): rename FunctionData to JsonData by @peterpeterparker in https://github.com/junobuild/juno/pull/2650
- feat(orbiter): use rename doc data types by @peterpeterparker in https://github.com/junobuild/juno/pull/2649
- feat(utils,macros): from and to json data traits by @peterpeterparker in https://github.com/junobuild/juno/pull/2651
- refactor(sputnik): move sdk to root by @peterpeterparker in https://github.com/junobuild/juno/pull/2652
- fix(frontend): OpenChat memo leads to "Offset is outside the bounds of the DataView" by @peterpeterparker in https://github.com/junobuild/juno/pull/2656
- feat(shared): unwrap_or_trap for option by @peterpeterparker in https://github.com/junobuild/juno/pull/2655
- feat(sputnik): shorten DEV_CUSTOM_FUNCTIONS_PATH to DEV_FUNCTIONS_PATH by @peterpeterparker in https://github.com/junobuild/juno/pull/2654
- build(backend): Update Rust version by @github-actions[bot] in https://github.com/junobuild/juno/pull/2653
- feat(sputnik): support generating custom endpoints by @peterpeterparker in https://github.com/junobuild/juno/pull/2636
- feat(sputnik): use tooling to generate custom functions by @peterpeterparker in https://github.com/junobuild/juno/pull/2657
- fix(sputnik): nested structs by @peterpeterparker in https://github.com/junobuild/juno/pull/2661
- fix(macros): register json_data as a helper attribute by @peterpeterparker in https://github.com/junobuild/juno/pull/2662
- fix(sputnik): serialization with option principal, uint8array and bigint by @peterpeterparker in https://github.com/junobuild/juno/pull/2659
- feat(sputnik): support for ic_cdk::caller by @peterpeterparker in https://github.com/junobuild/juno/pull/2660
- chore(test): bump pic-js v0.19.0 by @peterpeterparker in https://github.com/junobuild/juno/pull/2663
- build(sputnik): prevent build exception if no custom endpoints by @peterpeterparker in https://github.com/junobuild/juno/pull/2664
- build(frontend): use released juno-js libs by @peterpeterparker in https://github.com/junobuild/juno/pull/2667
- feat(frontend): import junobuild/zod instead of zod-schemas by @peterpeterparker in https://github.com/junobuild/juno/pull/2668
- chore(frontend): update eslint to fix globals version issue by @peterpeterparker in https://github.com/junobuild/juno/pull/2669
- fix(macros,sputnik): support for generated enums and deprecate z.union by @peterpeterparker in https://github.com/junobuild/juno/pull/2670
- build(frontend): use release cli and functions tools alongside schema instead of zod by @peterpeterparker in https://github.com/junobuild/juno/pull/2671
- feat(frontend): remove deprecated junobuild/zod and replace with schema by @peterpeterparker in https://github.com/junobuild/juno/pull/2672
- test(sputnik): use j by @peterpeterparker in https://github.com/junobuild/juno/pull/2673
- chore(release): set v71 by @peterpeterparker in https://github.com/junobuild/juno/pull/2674
- build(frontend): bump final juno-js libs for sputnik custom functions by @peterpeterparker in https://github.com/junobuild/juno/pull/2677
Full Changelog: https://github.com/junobuild/juno/compare/v0.0.70...v0.0.71