@podium/client
Advanced tools
Comparing version 5.0.0-next.12 to 5.0.0-next.13
@@ -0,1 +1,8 @@ | ||
# [5.0.0-next.13](https://github.com/podium-lib/client/compare/v5.0.0-next.12...v5.0.0-next.13) (2022-09-21) | ||
### Features | ||
* Support new proxy structure in manifest ([#295](https://github.com/podium-lib/client/issues/295)) ([d8aa28a](https://github.com/podium-lib/client/commit/d8aa28a59c8ab3fe66b146eecaaf487717599972)) | ||
# [5.0.0-next.12](https://github.com/podium-lib/client/compare/v5.0.0-next.11...v5.0.0-next.12) (2022-09-20) | ||
@@ -2,0 +9,0 @@ |
@@ -174,10 +174,44 @@ /* eslint-disable no-param-reassign */ | ||
// Build absolute proxy URIs | ||
Object.keys(manifest.value.proxy).forEach((key) => { | ||
manifest.value.proxy[key] = utils.uriRelativeToAbsolute( | ||
manifest.value.proxy[key], | ||
outgoing.manifestUri, | ||
); | ||
}); | ||
/* | ||
START: Proxy backwards compabillity check and handling | ||
If .proxy is and Array, the podlet are of version 6 or newer. The Array is then an | ||
Array of proxy Objects ({ name: 'foo', target: '/' }) which is the new structure | ||
wanted from version 6 and onwards so leave this structure untouched. | ||
If .proxy is an Object, the podlet are of version 5 or older where the key of the | ||
Object is the key of the target. If so, convert the structure to the new structure | ||
consisting of an Array of proxy Objects. | ||
This check can be removed in version 7 (requires all podlets to be on version 6) | ||
*/ | ||
if (Array.isArray(manifest.value.proxy)) { | ||
// Build absolute proxy URIs | ||
manifest.value.proxy = manifest.value.proxy.map((item) => ({ | ||
target: utils.uriRelativeToAbsolute( | ||
item.target, | ||
outgoing.manifestUri, | ||
), | ||
name: item.name, | ||
})); | ||
} else { | ||
const proxies = []; | ||
// Build absolute proxy URIs | ||
Object.keys(manifest.value.proxy).forEach((key) => { | ||
proxies.push({ | ||
target: utils.uriRelativeToAbsolute( | ||
manifest.value.proxy[key], | ||
outgoing.manifestUri, | ||
), | ||
name: key, | ||
}); | ||
}); | ||
manifest.value.proxy = proxies; | ||
} | ||
/* | ||
END: Proxy backwards compabillity check and handling | ||
*/ | ||
outgoing.manifest = manifest.value; | ||
@@ -184,0 +218,0 @@ outgoing.status = 'fresh'; |
{ | ||
"name": "@podium/client", | ||
"version": "5.0.0-next.12", | ||
"version": "5.0.0-next.13", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
104089
1383