Skip to content

Commit 30710b3

Browse files
committed
[RFC] 0011 Reuse Build Results
1 parent d2bd68d commit 30710b3

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
- Start Date: 2022-04-15
2+
- RFC PR: [#243](https://github.com/SAP/ui5-tooling/pull/000)
3+
- Issue: *none*
4+
- Affected components <!-- Check affected components by writing an "X" into the brackets -->
5+
+ [x] [ui5-builder](https://github.com/SAP/ui5-builder)
6+
+ [ ] [ui5-server](https://github.com/SAP/ui5-server)
7+
+ [ ] [ui5-cli](https://github.com/SAP/ui5-cli)
8+
+ [ ] [ui5-fs](https://github.com/SAP/ui5-fs)
9+
+ [x] [ui5-project](https://github.com/SAP/ui5-project)
10+
+ [ ] [ui5-logger](https://github.com/SAP/ui5-logger)
11+
12+
13+
# RFC 0011 Reuse Build Results
14+
15+
## Summary
16+
When building a project, it should be possible to consume build results of dependencies in order to not having to build them again.
17+
18+
Based on the requested build, UI5 Tooling should be able to identify which dependencies are required to be built. It should also be able to determine whether a provided build result of a dependency can be used, or whether a new build is required.
19+
20+
To be checked: Would it be necessary/helpful if users/projects define a set of "build-time" dependencies which always have to be built. Or can UI5 Tooling determine this by itself from the set of provided dependencies.
21+
22+
Declare dependencies required for build
23+
24+
build-dependencies
25+
26+
In a future enhancement, build results could be cached automatically. These could then be used in ui5-server.
27+
28+
## Motivation
29+
30+
As described in [RFC 0010 UI5 Builder-Bundling Refactoring](https://github.com/SAP/ui5-tooling/blob/master/rfcs/0010-ui5-builder-bundling-refactoring.md#missing-minification-for-resources-from-dependencies):
31+
32+
> There is a gap in the minification process which causes a regression for some scenarios. JavaScript resources from other projects (dependencies) are not minified when not building the project with the `--all` flag. This is because the bundling task does not perform the minification but rather relies on this to be done by the minify task.
33+
>
34+
> Requiring to always build a project with `--all` is not favorable due to performance reasons. Therefore, a solution is needed to still perform the needed minification steps for the mentioned resources.
35+
36+
### Known tasks that require dependencies
37+
38+
1. generateVersionInfo (`ApplicationBuilder`)
39+
* Requires manifest.json of dependencies in order to list them in the generated `sap-ui-version.json`
40+
1. generateResourcesJson (`ApplicationBuilder`)
41+
* Requires (built) runtime resources of dependencies in order to list them in the generated `resources.json`
42+
1. JSDoc generation
43+
1. executeJsdocSdkTransformation (`LibraryBuilder`)
44+
* Requires `designtime/api.json` of dependencies
45+
1. generateJsdoc (`LibraryBuilder`)
46+
* Requires `designtime/api.json` of dependencies
47+
1. generateApiIndex (`ApplicationBuilder`)
48+
1. buildThemes (`LibraryBuilder`, `ThemeLibraryBuilder`)
49+
* Requires theme resources of dependencies in order to build a library's theme. To be checked: Are the required resources already present in the dependency source? I.e. is it necessary to build them?
50+
1. generateThemeDesignerResources
51+
1. generateLibraryManifest
52+
1. Bundling
53+
1. generateComponentPreload *(actually not necessary? See https://github.com/SAP/ui5-builder/pull/734)*
54+
1. generateBundle *(in case dependencies are bundled too)*
55+
1. generateLibraryPreload *(actually not necessary? See https://github.com/SAP/ui5-builder/pull/734)*
56+
1. generateStandaloneAppBundle *(to bundle required runtime resources)* - Note: `build --all` is already recommended for self-contained builds in order to generate required theme resources which are not part of the standalone app bundle.
57+
58+
## Detailed design
59+
60+
<!-- This is the bulk of the RFC. Explain the design in enough detail for somebody familiar with the UI5 Tooling to understand, and for somebody familiar with the implementation to implement. This should get into specifics and corner-cases, and include examples of how the feature is used. Any new terminology should be defined here. -->
61+
62+
## How we teach this
63+
64+
<!--
65+
What names and terminology work best for these concepts and why? How is this idea best presented?
66+
67+
Would the acceptance of this proposal mean the UI5 Tooling or any of its subcomponents documentation must be re-organized or altered?
68+
69+
How should this feature be introduced and taught to existing UI5 Tooling users?
70+
-->
71+
72+
## Drawbacks
73+
74+
<!--
75+
Why should we not do this? Please consider the impact on teaching people to use the UI5 Tooling, on the integration of this feature with existing and planned features, on the impact of churn on existing users.
76+
77+
There are tradeoffs to choosing any path, please attempt to identify them here.
78+
-->
79+
80+
## Alternatives
81+
82+
<!--
83+
What other designs have been considered? What is the impact of not doing this?
84+
-->
85+
86+
## Unresolved Questions and Bikeshedding
87+
88+
<!--
89+
*This section should be removed (i.e. resolved) before merging*
90+
91+
Optional, but suggested for first drafts. What parts of the design are still TBD? Are there any second priority decisions left to be made?
92+
-->
93+
94+
Currently none.

0 commit comments

Comments
 (0)