@atlaskit/media-card 79.8.2 → 79.9.0

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/media-card
2
2
 
3
+ ## 79.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`2060fe01f7695`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2060fe01f7695) -
8
+ Optimised lazy loading by integrating the removal of lazy loading during SSR
9
+
10
+ ### Patch Changes
11
+
12
+ - [`2060fe01f7695`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2060fe01f7695) -
13
+ Add media-perf-lazy-loading-optimisation to perfObserver metrics to track impact
14
+ - Updated dependencies
15
+
3
16
  ## 79.8.2
4
17
 
5
18
  ### Patch Changes
@@ -20,7 +20,7 @@ var _label = _interopRequireDefault(require("@atlaskit/react-ufo/label"));
20
20
  var _excluded = ["identifier"];
21
21
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
22
22
  var packageName = "@atlaskit/media-card";
23
- var packageVersion = "79.8.1";
23
+ var packageVersion = "0.0.0-development";
24
24
  var CardBase = exports.CardBase = function CardBase(_ref) {
25
25
  var identifier = _ref.identifier,
26
26
  otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
@@ -587,13 +587,14 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
587
587
  var izLazyOverride = arguments.length > 2 ? arguments[2] : undefined;
588
588
  var mediaItemType = identifier.mediaItemType;
589
589
  var isLazyWithOverride = izLazyOverride === undefined ? isLazy : izLazyOverride;
590
+ var isLazyPreview = (0, _platformFeatureFlags.fg)('media-perf-lazy-loading-optimisation') ? preview === null || preview === void 0 ? void 0 : preview.lazy : true;
590
591
 
591
592
  // We should natively lazy load an SSR preview when card is not visible,
592
593
  // otherwise we'll fire the metadata fetch from outside the viewport
593
594
  // Side note: We should not lazy load if the cardPreview is available from local cache,
594
595
  // in order to avoid flickers during re-mount of the component
595
596
  // CXP-2723 TODO: Create test cases for the above scenarios
596
- var nativeLazyLoad = isLazyWithOverride && ((0, _platformFeatureFlags.fg)('media-perf-uplift-mutation-fix') || !isCardVisible) && preview && (0, _types.isSSRPreview)(preview);
597
+ var nativeLazyLoad = isLazyWithOverride && ((0, _platformFeatureFlags.fg)('media-perf-uplift-mutation-fix') || !isCardVisible) && preview && (0, _types.isSSRPreview)(preview) && isLazyPreview;
597
598
  // Force Media Image to always display img for SSR
598
599
  var forceSyncDisplay = !!ssr;
599
600
  var card = /*#__PURE__*/_react.default.createElement(_cardView.CardView, {
@@ -87,7 +87,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
87
87
  }(_react.default.Component);
88
88
  (0, _defineProperty2.default)(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
89
89
  var packageName = "@atlaskit/media-card";
90
- var packageVersion = "79.8.1";
90
+ var packageVersion = "0.0.0-development";
91
91
 
92
92
  // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
93
93
  var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
@@ -116,7 +116,7 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
116
116
  ErrorBoundary = _this$state.ErrorBoundary;
117
117
  var analyticsContext = {
118
118
  packageVersion: "@atlaskit/media-card",
119
- packageName: "79.8.1",
119
+ packageName: "0.0.0-development",
120
120
  componentName: 'mediaInlineCard',
121
121
  component: 'mediaInlineCard'
122
122
  };
@@ -39,7 +39,7 @@ var createAndGetResourceObserver = function createAndGetResourceObserver() {
39
39
  fileId: fileId,
40
40
  mediaClientId: clientId,
41
41
  featureFlags: {
42
- 'media-cdn-single-host': (0, _platformFeatureFlags.fg)('platform_media_cdn_single_host')
42
+ 'media-perf-lazy-loading-optimisation': (0, _platformFeatureFlags.fg)('media-perf-lazy-loading-optimisation')
43
43
  }
44
44
  }, mediaDurationMetrics)
45
45
  });
@@ -15,7 +15,7 @@ var _mediaClient = require("@atlaskit/media-client");
15
15
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
16
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
17
  var packageName = "@atlaskit/media-card";
18
- var packageVersion = "79.8.1";
18
+ var packageVersion = "0.0.0-development";
19
19
  var SAMPLE_RATE = 0.05;
20
20
  var concurrentExperience;
21
21
  var getExperience = function getExperience(id) {
@@ -9,7 +9,7 @@ import { startResourceObserver, setAnalyticsContext } from '../utils/mediaPerfor
9
9
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
10
10
  import UFOLabel from '@atlaskit/react-ufo/label';
11
11
  const packageName = "@atlaskit/media-card";
12
- const packageVersion = "79.8.1";
12
+ const packageVersion = "0.0.0-development";
13
13
  export const CardBase = ({
14
14
  identifier,
15
15
  ...otherProps
@@ -510,13 +510,14 @@ export const FileCard = ({
510
510
  mediaItemType
511
511
  } = identifier;
512
512
  const isLazyWithOverride = izLazyOverride === undefined ? isLazy : izLazyOverride;
513
+ let isLazyPreview = fg('media-perf-lazy-loading-optimisation') ? preview === null || preview === void 0 ? void 0 : preview.lazy : true;
513
514
 
514
515
  // We should natively lazy load an SSR preview when card is not visible,
515
516
  // otherwise we'll fire the metadata fetch from outside the viewport
516
517
  // Side note: We should not lazy load if the cardPreview is available from local cache,
517
518
  // in order to avoid flickers during re-mount of the component
518
519
  // CXP-2723 TODO: Create test cases for the above scenarios
519
- const nativeLazyLoad = isLazyWithOverride && (fg('media-perf-uplift-mutation-fix') || !isCardVisible) && preview && isSSRPreview(preview);
520
+ const nativeLazyLoad = isLazyWithOverride && (fg('media-perf-uplift-mutation-fix') || !isCardVisible) && preview && isSSRPreview(preview) && isLazyPreview;
520
521
  // Force Media Image to always display img for SSR
521
522
  const forceSyncDisplay = !!ssr;
522
523
  const card = /*#__PURE__*/React.createElement(CardView, {
@@ -66,7 +66,7 @@ class WrappedMediaCardAnalyticsErrorBoundary extends React.Component {
66
66
  }
67
67
  _defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
68
68
  const packageName = "@atlaskit/media-card";
69
- const packageVersion = "79.8.1";
69
+ const packageVersion = "0.0.0-development";
70
70
 
71
71
  // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
72
72
  const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
@@ -37,7 +37,7 @@ export default class MediaInlineCardLoader extends React.PureComponent {
37
37
  } = this.state;
38
38
  const analyticsContext = {
39
39
  packageVersion: "@atlaskit/media-card",
40
- packageName: "79.8.1",
40
+ packageName: "0.0.0-development",
41
41
  componentName: 'mediaInlineCard',
42
42
  component: 'mediaInlineCard'
43
43
  };
@@ -29,7 +29,7 @@ const createAndGetResourceObserver = () => {
29
29
  fileId: fileId,
30
30
  mediaClientId: clientId,
31
31
  featureFlags: {
32
- 'media-cdn-single-host': fg('platform_media_cdn_single_host')
32
+ 'media-perf-lazy-loading-optimisation': fg('media-perf-lazy-loading-optimisation')
33
33
  },
34
34
  ...mediaDurationMetrics
35
35
  }
@@ -5,7 +5,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
5
5
  import { MediaCardError } from '../errors';
6
6
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
7
7
  const packageName = "@atlaskit/media-card";
8
- const packageVersion = "79.8.1";
8
+ const packageVersion = "0.0.0-development";
9
9
  const SAMPLE_RATE = 0.05;
10
10
  let concurrentExperience;
11
11
  const getExperience = id => {
@@ -11,7 +11,7 @@ import { startResourceObserver, setAnalyticsContext } from '../utils/mediaPerfor
11
11
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
12
12
  import UFOLabel from '@atlaskit/react-ufo/label';
13
13
  var packageName = "@atlaskit/media-card";
14
- var packageVersion = "79.8.1";
14
+ var packageVersion = "0.0.0-development";
15
15
  export var CardBase = function CardBase(_ref) {
16
16
  var identifier = _ref.identifier,
17
17
  otherProps = _objectWithoutProperties(_ref, _excluded);
@@ -579,13 +579,14 @@ export var FileCard = function FileCard(_ref) {
579
579
  var izLazyOverride = arguments.length > 2 ? arguments[2] : undefined;
580
580
  var mediaItemType = identifier.mediaItemType;
581
581
  var isLazyWithOverride = izLazyOverride === undefined ? isLazy : izLazyOverride;
582
+ var isLazyPreview = fg('media-perf-lazy-loading-optimisation') ? preview === null || preview === void 0 ? void 0 : preview.lazy : true;
582
583
 
583
584
  // We should natively lazy load an SSR preview when card is not visible,
584
585
  // otherwise we'll fire the metadata fetch from outside the viewport
585
586
  // Side note: We should not lazy load if the cardPreview is available from local cache,
586
587
  // in order to avoid flickers during re-mount of the component
587
588
  // CXP-2723 TODO: Create test cases for the above scenarios
588
- var nativeLazyLoad = isLazyWithOverride && (fg('media-perf-uplift-mutation-fix') || !isCardVisible) && preview && isSSRPreview(preview);
589
+ var nativeLazyLoad = isLazyWithOverride && (fg('media-perf-uplift-mutation-fix') || !isCardVisible) && preview && isSSRPreview(preview) && isLazyPreview;
589
590
  // Force Media Image to always display img for SSR
590
591
  var forceSyncDisplay = !!ssr;
591
592
  var card = /*#__PURE__*/React.createElement(CardView, {
@@ -80,7 +80,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
80
80
  }(React.Component);
81
81
  _defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
82
82
  var packageName = "@atlaskit/media-card";
83
- var packageVersion = "79.8.1";
83
+ var packageVersion = "0.0.0-development";
84
84
 
85
85
  // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
86
86
  var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
@@ -101,7 +101,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
101
101
  ErrorBoundary = _this$state.ErrorBoundary;
102
102
  var analyticsContext = {
103
103
  packageVersion: "@atlaskit/media-card",
104
- packageName: "79.8.1",
104
+ packageName: "0.0.0-development",
105
105
  componentName: 'mediaInlineCard',
106
106
  component: 'mediaInlineCard'
107
107
  };
@@ -32,7 +32,7 @@ var createAndGetResourceObserver = function createAndGetResourceObserver() {
32
32
  fileId: fileId,
33
33
  mediaClientId: clientId,
34
34
  featureFlags: {
35
- 'media-cdn-single-host': fg('platform_media_cdn_single_host')
35
+ 'media-perf-lazy-loading-optimisation': fg('media-perf-lazy-loading-optimisation')
36
36
  }
37
37
  }, mediaDurationMetrics)
38
38
  });
@@ -8,7 +8,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
8
8
  import { MediaCardError } from '../errors';
9
9
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
10
10
  var packageName = "@atlaskit/media-card";
11
- var packageVersion = "79.8.1";
11
+ var packageVersion = "0.0.0-development";
12
12
  var SAMPLE_RATE = 0.05;
13
13
  var concurrentExperience;
14
14
  var getExperience = function getExperience(id) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "79.8.2",
3
+ "version": "79.9.0",
4
4
  "description": "Includes all media card related components, CardView, CardViewSmall, Card...",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/media-client": "^35.6.0",
40
40
  "@atlaskit/media-client-react": "^4.1.0",
41
41
  "@atlaskit/media-common": "^12.3.0",
42
- "@atlaskit/media-file-preview": "^0.14.0",
42
+ "@atlaskit/media-file-preview": "^0.15.0",
43
43
  "@atlaskit/media-svg": "^2.1.0",
44
44
  "@atlaskit/media-ui": "^28.7.0",
45
45
  "@atlaskit/media-viewer": "^52.4.0",
@@ -137,6 +137,9 @@
137
137
  },
138
138
  "media-perf-uplift-mutation-fix": {
139
139
  "type": "boolean"
140
+ },
141
+ "media-perf-lazy-loading-optimisation": {
142
+ "type": "boolean"
140
143
  }
141
144
  },
142
145
  "techstack": {