Skip to content

Commit 9bea2db

Browse files
committed
docs(documentation): Rework build-manifest integration
1 parent e5267e2 commit 9bea2db

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

rfcs/0017-incremental-build.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ The cache consists of two main parts:
8888
"buildManifest": {
8989
"manifestVersion": "1.0",
9090
"timestamp": "2025-11-24T13:43:24.612Z",
91+
"signature": "bb3a3262d893fcb9adf16bff63f", // <-- New "signature" attribute, uniquely identifying the build
9192
"versions": {
9293
"builderVersion": "5.0.0",
9394
"projectVersion": "5.0.0",
@@ -113,8 +114,7 @@ The cache consists of two main parts:
113114
}
114115
}
115116
},
116-
"cache": {
117-
"integrity": "bb3a3262d893fcb9adf16bff63f"
117+
"cache": { // <-- New "cache" section containing incremental build metadata
118118
"index": {
119119
// Map of source paths to their fs-stat metadata and content hashes
120120
"/resources/project/namespace/Component.js": {
@@ -126,27 +126,29 @@ The cache consists of two main parts:
126126
},
127127
"indexTimestamp": 1764688556165,
128128
"tasks": {
129-
"replaceCopyright": {
129+
"replaceCopyright": { // Task name
130130
"projectRequests": {
131+
// Resource paths and glob patterns requested from the project during task execution
131132
"pathsRead": [],
132133
"patterns": [
133134
"/**/*.{js,library,css,less,theme,html}"
134135
]
135136
},
136137
"dependencyRequests": {
138+
// Resource paths and glob patterns requested from dependencies during task execution
137139
"pathsRead": [],
138140
"patterns": []
139141
},
140142
"input": {
141-
// Map of logical paths read to their content hashes
143+
// Logical paths read by the task during execution, mapped to their cache metadata
142144
"/resources/project/namespace/Component.js": {
143145
"mtime": 1764688556165,
144146
"size": 1234,
145147
"integrity": "sha256-R70pB1+LgBnwvuxthr7afJv2eq8FBT3L4LO8tjloUX8="
146148
}
147149
},
148150
"output": {
149-
// Map of logical paths written to their content hashes
151+
// Logical paths written by the task during execution, mapped to their cache metadata
150152
"/resources/project/namespace/Component.js": {
151153
"mtime": 176468853453,
152154
"size": 4567,
@@ -161,25 +163,25 @@ The cache consists of two main parts:
161163

162164
The concept of a `build-manifest.json` has already been explored in [RFC 0011 Reuse Build Results](https://github.com/SAP/ui5-tooling/pull/612) and found an implementation for consumption of pre-built UI5 framework libraries in [UI5 3.0](https://github.com/UI5/cli/pull/612).
163165

164-
This concept reuses and extends the `build-manifest.json` idea to also include incremental build cache information. A new `cache` section is added to the manifest, containing all relevant metadata for the incremental build cache.
166+
This concept reuses and extends the `build-manifest.json` idea to also include incremental build cache information. In addition to a new `signature` attribute, added to the `buildManifest` section (which now defines version `1.0`), a new `cache` section is introduced, containing all relevant metadata for the incremental build cache.
165167

166-
##### Integrity
168+
##### Signature
167169

168-
The cache integrity is calculated based on the **build configuration and environment** of a project. It's purpose is to easily tell whether a cache can be reused for a project build or not.
170+
The signature is calculated based on the **build configuration and environment** of a project. It's purpose is to easily tell whether a cache can be reused for a project build or not.
169171

170-
The integrity is a simple hash (represented as a hexadecimal string), calculated from the following information:
172+
The signature is a simple hash (represented as a hexadecimal string, to allow usage in file names), calculated from the following information:
171173

172-
* Project namespace and version.
173-
* Different projects must produce different caches.
174+
* Project namespace and version
175+
* Different projects must produce different caches
174176
* The versions of all UI5 CLI packages used to create the cache: `@ui5/project`, `@ui5/builder` and `@ui5/fs`
175-
* Different UI5 CLI versions must produce a new cache. Alternatively, we could introduce a dedicated "cache version" that is incremented whenever a breaking change to the cache format is introduced. This would allow reusing the cache across minor UI5 CLI updates.
176-
* The relevant build configuration (ui5.yaml + CLI parameters).
177-
* Changes in the build configuration must result in dedicated cache.
178-
* Some configuration options might not be relevant for the build process (e.g. server configuration). Those could be excluded from the hash calculation to improve cache reusability.
179-
* The names and versions of all UI5 extensions in the dependency tree.
180-
* Changes to custom tasks must invalidate the cache. Even changes to their npm dependencies might invalidate the cache. Therefore, a hash of the current project's lockfile (e.g. package-lock.json, yarn.lock or pnpm-lock.yaml - if present) should be included in the cache key as well.
181-
* _**To be decided:** The names and versions of all UI5 projects in the dependency tree._
182-
* Changes in project dependencies might affect the build result of the current project. However, relying on resource-level cache invalidation might be sufficient to detect such changes.
177+
* Different UI5 CLI versions must produce a new cache. Alternatively, we could introduce a dedicated "cache version" that is incremented whenever a breaking change to the cache format is introduced. This would allow reusing the cache across minor UI5 CLI updates
178+
* The relevant build configuration (ui5.yaml + CLI parameters)
179+
* Changes in the build configuration must result in dedicated cache
180+
* Some configuration options might not be relevant for the build process (e.g. server configuration). Those could be excluded from the hash calculation to improve cache reusability
181+
* The names and versions of all UI5 extensions in the dependency tree
182+
* Changes to custom tasks must invalidate the cache. Even changes to their npm dependencies might invalidate the cache. Therefore, a hash of the current project's lockfile (e.g. package-lock.json, yarn.lock or pnpm-lock.yaml - if present) should be included in the cache key as well
183+
* _**To be decided:** The names and versions of all UI5 projects in the dependency tree_
184+
* Changes in project dependencies might affect the build result of the current project. However, relying on resource-level cache invalidation might be sufficient to detect such changes
183185

184186
##### Index
185187

@@ -204,7 +206,7 @@ It can also be used to protect against race conditions such as those described i
204206

205207
##### Tasks
206208

207-
An object containing entries for each build task executed during the build process.
209+
An object containing entries for each build task executed during the build process. Keys must be stored in the order of task execution.
208210

209211
For each task, the following information is stored:
210212

0 commit comments

Comments
 (0)