Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions internal/documentation/docs/pages/Builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ All available standard tasks are documented under **API -> @ui5/builder -> tasks
| [executeJsdocSdkTransformation](../api/module-@ui5_builder_tasks_jsdoc_executeJsdocSdkTransformation) | | | *disabled* <sup>1</sup> | |
| [minify](../api/module-@ui5_builder_tasks_minify) | enabled | enabled | enabled | |
| [generateFlexChangesBundle](../api/module-@ui5_builder_tasks_bundlers_generateFlexChangesBundle) | enabled | enabled | enabled | |
| [generateLibraryManifest](../api/module-@ui5_builder_tasks_generateLibraryManifest) | | | enabled | |
| [generateLibraryManifest](../api/module-@ui5_builder_tasks_generateLibraryManifest) | | | *disabled* <sup>7</sup> | |
| [enhanceManifest](../api/module-@ui5_builder_tasks_enhanceManifest) | enabled | enabled | enabled | |
| [generateComponentPreload](../api/module-@ui5_builder_tasks_bundlers_generateComponentPreload) | enabled | enabled | *disabled* <sup>2</sup> | |
| [generateLibraryPreload](../api/module-@ui5_builder_tasks_bundlers_generateLibraryPreload) | | | enabled | |
Expand All @@ -58,7 +58,8 @@ All available standard tasks are documented under **API -> @ui5/builder -> tasks
<sup>3</sup> Enabled in `self-contained` build, which disables `generateComponentPreload` and `generateLibraryPreload`
<sup>4</sup> Enabled for projects defining a [bundle configuration](./Configuration.md#custom-bundling)
<sup>5</sup> Can be enabled for framework projects via the `includeTask` option. For other projects, this task is skipped
<sup>6</sup> Disabled for the server due to a corresponding middleware producing the same output
<sup>6</sup> Disabled for the server due to a corresponding middleware producing the same output
<sup>7</sup> Enabled for Specification Version 4.0 and lower, and for framework projects. For other projects using Specification Version 5.0 and higher, this task is skipped

### minify

Expand Down
4 changes: 4 additions & 0 deletions internal/documentation/docs/pages/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,10 @@ Version | UI5 CLI Release

### Specification Version 5.0

**Breaking changes:**

- The `generateLibraryManifest` build task is no longer executed by default for projects of type `library`. Libraries must provide a `manifest.json` directly in their source directory. See [Migrate to v5: generateLibraryManifest Task No Longer Executed](../updates/migrate-v5.md#generatelibrarymanifest-task-no-longer-executed) for details.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer executed by default can give the impression that there is a way to still execute it. But I assume there isn't, right? (except for the framework projects, which are not mentioned here but maybe should be mentioned?).

Background:
Using --include-task generateLibraryManifest won't make a difference as this change makes the task a "no-op" instead of disabling it (composeTaskList). The task still exists and is included by default (so custom tasks can still refer to it, and that it still runs for specVersion < 5.0 / framework projects in the tree), but otherwise it is a no-op.
I think this is the best solution without inventing new concepts or changing a lot of existing code.


**Features:**

- Adds support for the new [`component`](./Project.md#component) project type for developing UI5 components — including application, reusable UI, and faceless components — which, unlike `application`-type projects, are served under their own namespace so multiple can coexist in one environment
Expand Down
17 changes: 17 additions & 0 deletions internal/documentation/docs/updates/migrate-v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@ UI5 CLI 5.x introduces **Specification Version 5.0**, which enables the new Comp

Projects using older **Specification Versions** are expected to be **fully compatible with UI5 CLI v5**.

## generateLibraryManifest Task No Longer Executed

::: info Specification Version 5.0 only
This change only applies to library projects that upgrade their `specVersion` to `5.0` in `ui5.yaml`. Projects on **Specification Version 4.0 and lower are not affected**.
:::

With **Specification Version 5.0**, the [`generateLibraryManifest`](../api/module-@ui5_builder_tasks_generateLibraryManifest) build task is no longer executed. Libraries must provide a `manifest.json` directly in their source directory.

**Action required** when upgrading a library project to Specification Version 5.0:

- Ensure your library has a hand-crafted `manifest.json` in its source directory.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be a good suggestion to run a build and copy the generated manifest.json from the build output before changing the specVersion to 5.0? I don't see a reason why people need to hand-craft it. They just need to check it into their sources now and make changes manually, but using the generated one would restore the previous behavior without much effort.

- If no `manifest.json` is present, the build will no longer generate one automatically.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know which consequences this would have? I tested it and did not get any warning or error, so I would assume people can easily miss this when upgrading to specVersion 5.0 without checking all details.


::: tip
To see which standard tasks are executed for each project type, check out the [Standard Tasks](../pages/Builder#standard-tasks) table in the UI5 Builder page.
:::

## Build Cache

UI5 CLI v5 introduces **builds with caching** for both the `ui5 build` and `ui5 serve` commands. This fundamental architectural change significantly improves build performance by reusing cached results from previous builds. It also simplifies development with the server by making most custom middleware obsolete.
Expand Down
7 changes: 6 additions & 1 deletion packages/project/lib/build/definitions/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ export default function({project, taskUtil, getTask}) {
}
});

tasks.set("generateLibraryManifest", {});
// For specVersion 5.0+, only execute for framework libraries
if (project.getSpecVersion().lt("5.0") || project.isFrameworkProject()) {
tasks.set("generateLibraryManifest", {});
} else {
tasks.set("generateLibraryManifest", {taskFunction: null});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently, the cache is not invalidated if a project now runs into this line. This means the old cache will be re-used (e.g. when already using specVersion 5.0 and then upgrading to a new pre-release that contains this change).

Those are the changes we have to watch out for, as using a stale cache is a bug that is often hard to find. We should maybe even invest into automated tests to ensure caching works as expected.

We have different options to resolve this. Bumping BUILD_SIG_VERSION would be the easiest (but invalidates all existing caches). Adding a determineBuildSignature callback would be a more fine-grained solution, which I would rather prefer. Otherwise we could think of generically detecting this by adding the "taskFunction" type (function / null) into the default signature.

}

tasks.set("enhanceManifest", {});

Expand Down
3 changes: 2 additions & 1 deletion packages/project/test/lib/build/TaskRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ function getMockProject(type) {
getMinificationExcludes: emptyarray,
getSpecVersion: () => {
return {
gte: () => false
gte: () => false,
lt: () => true
};
},
getComponentPreloadPaths: () => [
Expand Down
45 changes: 42 additions & 3 deletions packages/project/test/lib/build/definitions/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ function getMockProject() {
getSpecVersion: () => {
return {
toString: () => "2.6",
gte: () => true
gte: () => true,
lt: () => true
};
},
getMinificationExcludes: emptyarray,
Expand Down Expand Up @@ -187,7 +188,8 @@ test("Standard build with legacy spec version", (t) => {
project.getSpecVersion = () => {
return {
toString: () => "0.1",
gte: () => false
gte: () => false,
lt: () => true
};
};

Expand Down Expand Up @@ -507,7 +509,8 @@ test("Minification excludes not applied for legacy specVersion", (t) => {
project.getSpecVersion = () => {
return {
toString: () => "2.5",
gte: () => false
gte: () => false,
lt: () => true
};
};
project.getMinificationExcludes = () => ["**.html"];
Expand Down Expand Up @@ -639,6 +642,42 @@ test("buildThemes: Project is not root", (t) => {
}
}, "Correct buildThemes task definition");
});
test("generateLibraryManifest: specVersion 5.0, non-framework project", (t) => {
const {project, taskUtil, getTask} = t.context;

project.getSpecVersion = () => {
return {
toString: () => "5.0",
gte: () => true,
lt: () => false
};
};
project.isFrameworkProject = () => false;

const tasks = library({project, taskUtil, getTask});

t.deepEqual(tasks.get("generateLibraryManifest"), {taskFunction: null},
"generateLibraryManifest is skipped for non-framework libraries on specVersion 5.0");
});

test("generateLibraryManifest: specVersion 5.0, framework project", (t) => {
const {project, taskUtil, getTask} = t.context;

project.getSpecVersion = () => {
return {
toString: () => "5.0",
gte: () => true,
lt: () => false
};
};
project.isFrameworkProject = () => true;

const tasks = library({project, taskUtil, getTask});

t.deepEqual(tasks.get("generateLibraryManifest"), {},
"generateLibraryManifest runs for framework libraries on specVersion 5.0");
});

test("buildThemes: CSS Variables enabled", (t) => {
const {project, taskUtil, getTask} = t.context;
taskUtil.getBuildOption.returns(true);
Expand Down
Loading