You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Affected components <!-- Check affected components by writing an "X" into the brackets -->
5
-
+[x][ui5-builder](./packages/builder)
6
-
+[ ][ui5-server](./packages/server)
7
-
+[ ][ui5-cli](./packages/cli)
8
-
+[ ][ui5-fs](./packages/fs)
9
-
+[ ][ui5-project](./packages/project)
10
-
+[ ][ui5-logger](./packages/logger)
5
+
+[x][builder](./packages/builder)
6
+
+[ ][server](./packages/server)
7
+
+[ ][cli](./packages/cli)
8
+
+[ ][fs](./packages/fs)
9
+
+[ ][project](./packages/project)
10
+
+[ ][logger](./packages/logger)
11
11
12
12
13
13
# RFC 0019 Bundle Info Preload
@@ -23,7 +23,7 @@ This allows the UI5 runtime to always load the small `library-preload.js` for al
23
23
24
24
## Motivation
25
25
26
-
Currently, UI5 applications often declare library dependencies as "lazy" in their `manifest.json` to improve initial loading times. However, this requires developers to explicitly load these libraries using `sap/ui/core/Lib#load("sap.m")` (or the deprecated variant `sap.ui.getCore().loadLibrary("sap.m")`) before any of their modules can be used. This is a manual and error-prone process.
26
+
Currently, UI5 applications often declare library dependencies as "lazy" in their `manifest.json` to improve initial loading times. However, this requires developers to explicitly load these libraries using `sap/ui/core/Lib.load("sap.m")` (or the deprecated variant `sap.ui.getCore().loadLibrary("sap.m")`) before any of their modules can be used. This is a manual and error-prone process.
27
27
28
28
By splitting the library preload, the essential part of a library can be loaded eagerly without a significant performance penalty. The UI5 loader can then automatically fetch the larger part of the library when it's first needed.
29
29
@@ -34,7 +34,7 @@ This leads to the following benefits:
34
34
35
35
## Detailed design
36
36
37
-
The implementation of "Bundle-Info Preload" shall be handled by the UI5 CLI, specifically in the `ui5-builder` package.
37
+
The implementation of "Bundle-Info Preload" shall be handled by the UI5 CLI, specifically in the `builder` package.
38
38
39
39
### Bundling Process
40
40
@@ -68,13 +68,14 @@ Note that this manifest attribute will only be added in a later manifest version
68
68
69
69
### Planned Runtime Behavior
70
70
71
-
In a future UI5 framework release the following behavior might be implemented:
71
+
In a future UI5 framework release the following behavior might be implemented. Note that the detailed design for this is out of scope of this RFC, which rather focuses on the UI5 CLI implementation.
72
72
73
73
1. The application's `manifest.json` is loaded first.
74
74
2. The UI5 runtime analyzes the library dependencies.
75
-
3. For every library dependency (eager or lazy), it requests the corresponding `library-preload.js` file.
76
-
4. When application code requests a module from a library for the first time, the UI5 loader checks the bundle-info from the already loaded `library-preload.js`.
77
-
5. If the module is located in the secondary bundle, the loader requests the `_library-content.js` file and then provides the requested module. Subsequent requests for modules from that bundle are served directly from the loaded bundle similar to the "legacy" `library-preload.js`.
75
+
3. For every library dependency (eager or lazy), it requests the corresponding `library-preload.js` as well as the `manifest.json`
76
+
4. The UI5 loader checks the presence of the `"bundleVersion": 2` flag in the library's manifest and produces an error in case it is missing.
77
+
5. When application code requests a module from a library for the first time, the UI5 loader checks the bundle-info from the already loaded `library-preload.js`.
78
+
6. If the module is located in the secondary bundle, the loader requests the `_library-content.js` file and then provides the requested module. Subsequent requests for modules from that bundle are served directly from the loaded bundle similar to the "legacy" `library-preload.js`.
78
79
79
80
### Handling `manifest.json` in `library-preload.js`
80
81
@@ -95,9 +96,9 @@ The "Bundle-Info Preload" feature is designed to work transparently for most dev
95
96
96
97
## Drawbacks
97
98
98
-
UI5 releases prior to version 1.74 do not provide all required UI5 loader features, making the new bundling incompatible with these versions. Developers still targeting older releases (such as 1.71) will need to stick with an older release of UI5 CLI where the new bundling is not used.
99
+
UI5 releases prior to version 1.74 do not provide all required UI5 loader features, making the new bundling incompatible with these versions. Developers still targeting older releases (such as 1.71) will need to be able to disable the new bundling behavior, or be provided with a long-term maintenance version of UI5 CLI v4, which continues to use the legacy bundling strategy.
99
100
100
-
Similarly, the addition of the manifest flag requires the use of a specific manifest version which might not be supported by older UI5 releases. However, due to lack of validation of the manifest version in older UI5 releases, this is not expected to cause practical issues.
101
+
Similarly, the addition of the manifest flag requires the use of a specific minimum manifest version which might not be supported by older UI5 releases. This might cause problems if any validation is done on the final manifest, e.g. during deployment or at runtime.
101
102
102
103
Another drawback is the introduction of an additional request for the `_library-content.js` file. However, this request only occurs if the library is actually used, and it happens in parallel with other requests. For libraries that are declared but never used, this approach saves bandwidth by not loading the large content bundle at all. For eagerly used libraries, the performance impact is expected to be negligible and outweighed by the benefits of parallel loading and simplified development.
103
104
@@ -113,5 +114,6 @@ There is also a minor risk of confusion if developers are not aware of the new b
113
114
114
115
*This section should be removed (i.e. resolved) before merging*
115
116
116
-
The core concepts seem to be well-defined. The main points for final confirmation are:
117
-
- Final confirmation from colleagues on the name and location of the manifest flag (`"sap.ui5".library.bundleVersion`)
117
+
- Final confirmation from colleagues on the name and location of the manifest flag (`"sap.ui5".library.bundleVersion`) as well as the required minimum manifest version
118
+
- Clarification on how the new manifest version can be used in old UI5 versions
119
+
- Clarification on how UI5 1.71 development can still be supported
0 commit comments