@atlaskit/media-common 13.3.0 → 13.3.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 +21 -0
- package/dist/cjs/utils/mediaEnvUtils.js +24 -0
- package/dist/es2019/utils/mediaEnvUtils.js +18 -0
- package/dist/esm/utils/mediaEnvUtils.js +18 -0
- package/dist/types/utils/mediaEnvUtils.d.ts +10 -0
- package/dist/types-ts4.5/utils/mediaEnvUtils.d.ts +10 -0
- package/mediaEnvUtils/package.json +15 -0
- package/package.json +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/media-common
|
|
2
2
|
|
|
3
|
+
## 13.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c0dbd7b223090`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c0dbd7b223090) -
|
|
8
|
+
Add `isGCPtenant()` utility to `media-common` and guard CDN delivery in `media-client` for GCP
|
|
9
|
+
tenants.
|
|
10
|
+
|
|
11
|
+
CDN (CloudFront) is an AWS service that is not available on GCP tenants. Browser CDN GET requests
|
|
12
|
+
were failing with HTTP 500 on GCP environments because `isCDNEnabled()` had no guard for GCP. This
|
|
13
|
+
fix adds `!isGCPtenant()` to `isCDNEnabled()` and to the inner feature-flag check in
|
|
14
|
+
`mapToMediaCdnUrl()`, mirroring the existing `isIsolatedCloud()` pattern.
|
|
15
|
+
|
|
16
|
+
## 13.3.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`2fe9a9909d2ac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2fe9a9909d2ac) -
|
|
21
|
+
Enrol media packages into the React Compiler with platform gating via
|
|
22
|
+
isReactCompilerActivePlatform
|
|
23
|
+
|
|
3
24
|
## 13.3.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isGCPtenant = isGCPtenant;
|
|
7
|
+
/**
|
|
8
|
+
* Returns true if the current hostname matches the GCP tenant pattern.
|
|
9
|
+
* GCP tenants follow the pattern: <name>-cdp-<cdp-id>.jira-dev.com
|
|
10
|
+
*
|
|
11
|
+
* CDN (CloudFront) is an AWS service and is not available on GCP tenants.
|
|
12
|
+
* This function is used to gate CDN delivery, mirroring the isIsolatedCloud() pattern.
|
|
13
|
+
*
|
|
14
|
+
* @param hostname - Optional hostname override (defaults to globalThis.location?.hostname). Used for testing.
|
|
15
|
+
*/
|
|
16
|
+
function isGCPtenant(hostname) {
|
|
17
|
+
var _location;
|
|
18
|
+
var host = hostname !== null && hostname !== void 0 ? hostname : typeof globalThis !== 'undefined' ? (_location = globalThis.location) === null || _location === void 0 ? void 0 : _location.hostname : undefined;
|
|
19
|
+
if (!host) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
var gcpTenantPattern = /^.*-cdp-\w+\.jira-dev\.com$/;
|
|
23
|
+
return gcpTenantPattern.test(host);
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns true if the current hostname matches the GCP tenant pattern.
|
|
3
|
+
* GCP tenants follow the pattern: <name>-cdp-<cdp-id>.jira-dev.com
|
|
4
|
+
*
|
|
5
|
+
* CDN (CloudFront) is an AWS service and is not available on GCP tenants.
|
|
6
|
+
* This function is used to gate CDN delivery, mirroring the isIsolatedCloud() pattern.
|
|
7
|
+
*
|
|
8
|
+
* @param hostname - Optional hostname override (defaults to globalThis.location?.hostname). Used for testing.
|
|
9
|
+
*/
|
|
10
|
+
export function isGCPtenant(hostname) {
|
|
11
|
+
var _location;
|
|
12
|
+
const host = hostname !== null && hostname !== void 0 ? hostname : typeof globalThis !== 'undefined' ? (_location = globalThis.location) === null || _location === void 0 ? void 0 : _location.hostname : undefined;
|
|
13
|
+
if (!host) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
const gcpTenantPattern = /^.*-cdp-\w+\.jira-dev\.com$/;
|
|
17
|
+
return gcpTenantPattern.test(host);
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns true if the current hostname matches the GCP tenant pattern.
|
|
3
|
+
* GCP tenants follow the pattern: <name>-cdp-<cdp-id>.jira-dev.com
|
|
4
|
+
*
|
|
5
|
+
* CDN (CloudFront) is an AWS service and is not available on GCP tenants.
|
|
6
|
+
* This function is used to gate CDN delivery, mirroring the isIsolatedCloud() pattern.
|
|
7
|
+
*
|
|
8
|
+
* @param hostname - Optional hostname override (defaults to globalThis.location?.hostname). Used for testing.
|
|
9
|
+
*/
|
|
10
|
+
export function isGCPtenant(hostname) {
|
|
11
|
+
var _location;
|
|
12
|
+
var host = hostname !== null && hostname !== void 0 ? hostname : typeof globalThis !== 'undefined' ? (_location = globalThis.location) === null || _location === void 0 ? void 0 : _location.hostname : undefined;
|
|
13
|
+
if (!host) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
var gcpTenantPattern = /^.*-cdp-\w+\.jira-dev\.com$/;
|
|
17
|
+
return gcpTenantPattern.test(host);
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns true if the current hostname matches the GCP tenant pattern.
|
|
3
|
+
* GCP tenants follow the pattern: <name>-cdp-<cdp-id>.jira-dev.com
|
|
4
|
+
*
|
|
5
|
+
* CDN (CloudFront) is an AWS service and is not available on GCP tenants.
|
|
6
|
+
* This function is used to gate CDN delivery, mirroring the isIsolatedCloud() pattern.
|
|
7
|
+
*
|
|
8
|
+
* @param hostname - Optional hostname override (defaults to globalThis.location?.hostname). Used for testing.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isGCPtenant(hostname?: string): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns true if the current hostname matches the GCP tenant pattern.
|
|
3
|
+
* GCP tenants follow the pattern: <name>-cdp-<cdp-id>.jira-dev.com
|
|
4
|
+
*
|
|
5
|
+
* CDN (CloudFront) is an AWS service and is not available on GCP tenants.
|
|
6
|
+
* This function is used to gate CDN delivery, mirroring the isIsolatedCloud() pattern.
|
|
7
|
+
*
|
|
8
|
+
* @param hostname - Optional hostname override (defaults to globalThis.location?.hostname). Used for testing.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isGCPtenant(hostname?: string): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/media-common/mediaEnvUtils",
|
|
3
|
+
"main": "../dist/cjs/utils/mediaEnvUtils.js",
|
|
4
|
+
"module": "../dist/esm/utils/mediaEnvUtils.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/utils/mediaEnvUtils.js",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"types": "../dist/types/utils/mediaEnvUtils.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.5 <5.9": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.5/utils/mediaEnvUtils.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-common",
|
|
3
|
-
"version": "13.3.
|
|
3
|
+
"version": "13.3.2",
|
|
4
4
|
"description": "Includes common utilities used by other media packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -23,6 +23,13 @@
|
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"atlaskit:src": "src/index.ts",
|
|
25
25
|
"atlassian": {
|
|
26
|
+
"react-compiler": {
|
|
27
|
+
"enabled": true,
|
|
28
|
+
"gating": {
|
|
29
|
+
"source": "@atlassian/react-compiler-gating",
|
|
30
|
+
"importSpecifierName": "isReactCompilerActivePlatform"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
26
33
|
"team": "Media Exif",
|
|
27
34
|
"website": {
|
|
28
35
|
"name": "Media Common"
|
|
@@ -30,7 +37,7 @@
|
|
|
30
37
|
},
|
|
31
38
|
"dependencies": {
|
|
32
39
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
33
|
-
"@atlaskit/analytics-namespaced-context": "^7.
|
|
40
|
+
"@atlaskit/analytics-namespaced-context": "^7.3.0",
|
|
34
41
|
"@atlaskit/analytics-next": "^11.2.0",
|
|
35
42
|
"@atlaskit/link": "^3.4.0",
|
|
36
43
|
"@atlaskit/section-message": "^8.12.0",
|
|
@@ -48,6 +55,7 @@
|
|
|
48
55
|
}
|
|
49
56
|
},
|
|
50
57
|
"devDependencies": {
|
|
58
|
+
"@atlassian/react-compiler-gating": "workspace:^",
|
|
51
59
|
"enzyme": "^3.10.0",
|
|
52
60
|
"react": "^18.2.0",
|
|
53
61
|
"react-dom": "^18.2.0"
|