Skip to content

Commit d70e8ec

Browse files
committed
docs(documentation): Address review comments
1 parent d1c6438 commit d70e8ec

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

rfcs/0019-bundle-info-preload.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
- RFC PR: [#1194](https://github.com/UI5/cli/pull/1194)
33
- Issue: -
44
- 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)
1111

1212

1313
# RFC 0019 Bundle Info Preload
@@ -23,7 +23,7 @@ This allows the UI5 runtime to always load the small `library-preload.js` for al
2323

2424
## Motivation
2525

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.
2727

2828
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.
2929

@@ -34,7 +34,7 @@ This leads to the following benefits:
3434

3535
## Detailed design
3636

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.
3838

3939
### Bundling Process
4040

@@ -68,13 +68,14 @@ Note that this manifest attribute will only be added in a later manifest version
6868

6969
### Planned Runtime Behavior
7070

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.
7272

7373
1. The application's `manifest.json` is loaded first.
7474
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`.
7879

7980
### Handling `manifest.json` in `library-preload.js`
8081

@@ -95,9 +96,9 @@ The "Bundle-Info Preload" feature is designed to work transparently for most dev
9596

9697
## Drawbacks
9798

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.
99100

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.
101102

102103
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.
103104

@@ -113,5 +114,6 @@ There is also a minor risk of confusion if developers are not aware of the new b
113114

114115
*This section should be removed (i.e. resolved) before merging*
115116

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

Comments
 (0)