diff --git a/.versionbot/CHANGELOG.yml b/.versionbot/CHANGELOG.yml index ec30a2ea..5cf08605 100644 --- a/.versionbot/CHANGELOG.yml +++ b/.versionbot/CHANGELOG.yml @@ -1,3 +1,49 @@ +- commits: + - subject: Remove side effects for module imports + hash: 48e0733c7e734b401f6072df5a396dfc04075d98 + body: | + The supervisor uses the following pattern for async module + initialization + + ```typescript + // module.ts + + export const initialised = (async () => { + // do some async initialization + })(); + + // somewhere else + import * as module from 'module'; + + async function setup() { + await module.initialise; + } + ``` + + The above pattern means that whenever the module is imported, the + initialisation procedure will be ran, which is an anti-pattern. + + This converts any instance of this pattern into a function + + ```typescript + export const initialised = _.once(async () => { + // do some async initialization + }); + ``` + + And anywhere else on the code it replaces the call with a + + ```typescript + await module.initialised(); + ``` + footer: + Change-type: patch + change-type: patch + author: Felipe Lalanne + nested: [] + version: 14.0.17 + title: "'Remove side effects for module imports'" + date: 2022-09-06T19:50:43.463Z - commits: - subject: Add custom DTB support for imx8mm-var-som hash: 36544b7d6e53c8a501a6def40ac0370346e63b78 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bec23cc..a214a1f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY! This project adheres to [Semantic Versioning](http://semver.org/). +# v14.0.17 +## (2022-09-06) + +* Remove side effects for module imports [Felipe Lalanne] + # v14.0.16 ## (2022-09-06) diff --git a/VERSION b/VERSION index 1b8df774..64cef64f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -14.0.16 \ No newline at end of file +14.0.17 \ No newline at end of file diff --git a/balena.yml b/balena.yml index 75e52cee..cdca0c38 100644 --- a/balena.yml +++ b/balena.yml @@ -2,6 +2,6 @@ name: balena-supervisor description: 'Balena Supervisor: balena''s agent on devices.' joinable: false type: sw.application -version: 14.0.16 +version: 14.0.17 provides: - slug: sw.compose.long-volume-syntax diff --git a/package-lock.json b/package-lock.json index 58d97c00..8a217a1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "balena-supervisor", - "version": "14.0.16", + "version": "14.0.17", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 279842fc..23c5e230 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "balena-supervisor", "description": "This is balena's Supervisor, a program that runs on IoT devices and has the task of running user Apps (which are Docker containers), and updating them as the balena API informs it to.", - "version": "14.0.16", + "version": "14.0.17", "license": "Apache-2.0", "repository": { "type": "git", @@ -140,6 +140,6 @@ } }, "versionist": { - "publishedAt": "2022-09-06T14:36:03.587Z" + "publishedAt": "2022-09-06T19:50:43.834Z" } }