@ui5/server 4.0.0 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -1
- package/lib/middleware/serveResources.js +11 -3
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,19 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
|
-
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-server/compare/v4.0.
|
|
5
|
+
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-server/compare/v4.0.2...HEAD).
|
|
6
|
+
|
|
7
|
+
<a name="v4.0.2"></a>
|
|
8
|
+
## [v4.0.2] - 2024-08-01
|
|
9
|
+
### Dependency Updates
|
|
10
|
+
- Bump devcert-sanscache from 0.4.8 to 5.0.1 [`4a06c57`](https://github.com/SAP/ui5-server/commit/4a06c579c510d567ea214d565a490327c0b481d0)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<a name="v4.0.1"></a>
|
|
14
|
+
## [v4.0.1] - 2024-07-31
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
- **serveResources:** Improve cache invalidation ([#688](https://github.com/SAP/ui5-server/issues/688)) [`777afa5`](https://github.com/SAP/ui5-server/commit/777afa52e459f988e0799ae63b8a9b024db0c398)
|
|
17
|
+
|
|
6
18
|
|
|
7
19
|
<a name="v4.0.0"></a>
|
|
8
20
|
## [v4.0.0] - 2024-07-23
|
|
@@ -363,6 +375,8 @@ Only Node.js v10 or higher is supported.
|
|
|
363
375
|
|
|
364
376
|
<a name="v0.0.1"></a>
|
|
365
377
|
## v0.0.1 - 2018-06-06
|
|
378
|
+
[v4.0.2]: https://github.com/SAP/ui5-server/compare/v4.0.1...v4.0.2
|
|
379
|
+
[v4.0.1]: https://github.com/SAP/ui5-server/compare/v4.0.0...v4.0.1
|
|
366
380
|
[v4.0.0]: https://github.com/SAP/ui5-server/compare/v3.1.5...v4.0.0
|
|
367
381
|
[v3.2.1]: https://github.com/SAP/ui5-server/compare/v3.2.0...v3.2.1
|
|
368
382
|
[v3.2.0]: https://github.com/SAP/ui5-server/compare/v3.1.5...v3.2.0
|
|
@@ -95,10 +95,18 @@ function createMiddleware({resources, middlewareUtil}) {
|
|
|
95
95
|
|
|
96
96
|
// Enable ETag caching
|
|
97
97
|
const statInfo = resource.getStatInfo();
|
|
98
|
-
if (statInfo?.size !== undefined) {
|
|
99
|
-
|
|
98
|
+
if (statInfo?.size !== undefined && !resource.isModified()) {
|
|
99
|
+
let etagHeader = etag(statInfo);
|
|
100
|
+
if (resource.getProject()) {
|
|
101
|
+
// Add project version to ETag to invalidate cache when project version changes.
|
|
102
|
+
// This is necessary to invalidate files with ${version} placeholders.
|
|
103
|
+
etagHeader = etagHeader.slice(0, -1) + `-${resource.getProject().getVersion()}"`;
|
|
104
|
+
}
|
|
105
|
+
res.setHeader("ETag", etagHeader);
|
|
100
106
|
} else {
|
|
101
|
-
// Fallback to buffer if stats are not available or insufficient
|
|
107
|
+
// Fallback to buffer if stats are not available or insufficient or resource is modified.
|
|
108
|
+
// Modified resources must use the buffer for cache invalidation so that UI5 Tooling changes
|
|
109
|
+
// invalidate the cache even when the original resource is not modified.
|
|
102
110
|
res.setHeader("ETag", etag(await resource.getBuffer()));
|
|
103
111
|
}
|
|
104
112
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/server",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "UI5 Tooling - Server",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "SAP SE",
|
|
@@ -117,13 +117,13 @@
|
|
|
117
117
|
"url": "git@github.com:SAP/ui5-server.git"
|
|
118
118
|
},
|
|
119
119
|
"dependencies": {
|
|
120
|
-
"@ui5/builder": "^4.0.
|
|
120
|
+
"@ui5/builder": "^4.0.1",
|
|
121
121
|
"@ui5/fs": "^4.0.0",
|
|
122
122
|
"@ui5/logger": "^4.0.1",
|
|
123
123
|
"body-parser": "^1.20.2",
|
|
124
124
|
"compression": "^1.7.4",
|
|
125
125
|
"cors": "^2.8.5",
|
|
126
|
-
"devcert-sanscache": "^0.
|
|
126
|
+
"devcert-sanscache": "^0.5.1",
|
|
127
127
|
"escape-html": "^1.0.3",
|
|
128
128
|
"etag": "^1.8.1",
|
|
129
129
|
"express": "^4.19.2",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
},
|
|
140
140
|
"devDependencies": {
|
|
141
141
|
"@istanbuljs/esm-loader-hook": "^0.2.0",
|
|
142
|
-
"@ui5/project": "^4.0.
|
|
142
|
+
"@ui5/project": "^4.0.2",
|
|
143
143
|
"ava": "^6.1.3",
|
|
144
144
|
"chokidar-cli": "^3.0.0",
|
|
145
145
|
"cross-env": "^7.0.3",
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
"eslint": "^8.57.0",
|
|
149
149
|
"eslint-config-google": "^0.14.0",
|
|
150
150
|
"eslint-plugin-ava": "^14.0.0",
|
|
151
|
-
"eslint-plugin-jsdoc": "^48.
|
|
151
|
+
"eslint-plugin-jsdoc": "^48.10.2",
|
|
152
152
|
"esmock": "^2.6.7",
|
|
153
153
|
"jsdoc": "^4.0.3",
|
|
154
154
|
"nyc": "^17.0.0",
|