@atlaskit/profilecard 18.2.1 → 18.2.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 18.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7d2488dcbcf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7d2488dcbcf) - Upgrade lru-fast@0.2.2 to lru_map
8
+
3
9
  ## 18.2.1
4
10
 
5
11
  ### Patch Changes
@@ -13,7 +13,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
13
13
 
14
14
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
15
 
16
- var _lruFast = require("lru-fast");
16
+ var _lru_map = require("lru_map");
17
17
 
18
18
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
19
 
@@ -36,13 +36,13 @@ var CachingClient = /*#__PURE__*/function () {
36
36
  } // Only set cache if maxCacheAge and cacheSize are set
37
37
 
38
38
 
39
- this.cache = !this.config.cacheMaxAge || !this.config.cacheSize ? null : new _lruFast.LRUCache(this.config.cacheSize);
39
+ this.cache = !this.config.cacheMaxAge || !this.config.cacheSize ? null : new _lru_map.LRUMap(this.config.cacheSize);
40
40
  }
41
41
 
42
42
  (0, _createClass2.default)(CachingClient, [{
43
43
  key: "setCachedProfile",
44
44
  value: function setCachedProfile(cacheIdentifier, profile) {
45
- this.cache && this.cache.put(cacheIdentifier, {
45
+ this.cache && this.cache.set(cacheIdentifier, {
46
46
  expire: Date.now() + this.config.cacheMaxAge,
47
47
  profile: profile
48
48
  });
@@ -61,7 +61,7 @@ var CachingClient = /*#__PURE__*/function () {
61
61
  }
62
62
 
63
63
  if (cached.expire < Date.now()) {
64
- this.cache.remove(cacheIdentifier);
64
+ this.cache.delete(cacheIdentifier);
65
65
  return null;
66
66
  } // Extend expiry "date"
67
67
 
@@ -73,7 +73,7 @@ var CachingClient = /*#__PURE__*/function () {
73
73
  key: "flushCache",
74
74
  value: function flushCache() {
75
75
  if (this.cache) {
76
- this.cache.removeAll();
76
+ this.cache.clear();
77
77
  }
78
78
  }
79
79
  }]);
@@ -59,7 +59,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
59
59
  actionSubjectId: actionSubjectId,
60
60
  attributes: _objectSpread(_objectSpread({
61
61
  packageName: "@atlaskit/profilecard",
62
- packageVersion: "18.2.1"
62
+ packageVersion: "18.2.2"
63
63
  }, attributes), {}, {
64
64
  firedAt: Math.round((0, _performance.getPageTime)())
65
65
  })
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "18.2.1"
3
+ "version": "18.2.2"
4
4
  }
@@ -1,4 +1,4 @@
1
- import { LRUCache } from 'lru-fast';
1
+ import { LRUMap } from 'lru_map';
2
2
  export default class CachingClient {
3
3
  constructor(config) {
4
4
  const defaults = {
@@ -17,11 +17,11 @@ export default class CachingClient {
17
17
  } // Only set cache if maxCacheAge and cacheSize are set
18
18
 
19
19
 
20
- this.cache = !this.config.cacheMaxAge || !this.config.cacheSize ? null : new LRUCache(this.config.cacheSize);
20
+ this.cache = !this.config.cacheMaxAge || !this.config.cacheSize ? null : new LRUMap(this.config.cacheSize);
21
21
  }
22
22
 
23
23
  setCachedProfile(cacheIdentifier, profile) {
24
- this.cache && this.cache.put(cacheIdentifier, {
24
+ this.cache && this.cache.set(cacheIdentifier, {
25
25
  expire: Date.now() + this.config.cacheMaxAge,
26
26
  profile
27
27
  });
@@ -39,7 +39,7 @@ export default class CachingClient {
39
39
  }
40
40
 
41
41
  if (cached.expire < Date.now()) {
42
- this.cache.remove(cacheIdentifier);
42
+ this.cache.delete(cacheIdentifier);
43
43
  return null;
44
44
  } // Extend expiry "date"
45
45
 
@@ -50,7 +50,7 @@ export default class CachingClient {
50
50
 
51
51
  flushCache() {
52
52
  if (this.cache) {
53
- this.cache.removeAll();
53
+ this.cache.clear();
54
54
  }
55
55
  }
56
56
 
@@ -38,7 +38,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
38
38
  actionSubjectId,
39
39
  attributes: {
40
40
  packageName: "@atlaskit/profilecard",
41
- packageVersion: "18.2.1",
41
+ packageVersion: "18.2.2",
42
42
  ...attributes,
43
43
  firedAt: Math.round(getPageTime())
44
44
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "18.2.1"
3
+ "version": "18.2.2"
4
4
  }
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
 
7
7
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
8
 
9
- import { LRUCache } from 'lru-fast';
9
+ import { LRUMap } from 'lru_map';
10
10
 
11
11
  var CachingClient = /*#__PURE__*/function () {
12
12
  function CachingClient(config) {
@@ -26,13 +26,13 @@ var CachingClient = /*#__PURE__*/function () {
26
26
  } // Only set cache if maxCacheAge and cacheSize are set
27
27
 
28
28
 
29
- this.cache = !this.config.cacheMaxAge || !this.config.cacheSize ? null : new LRUCache(this.config.cacheSize);
29
+ this.cache = !this.config.cacheMaxAge || !this.config.cacheSize ? null : new LRUMap(this.config.cacheSize);
30
30
  }
31
31
 
32
32
  _createClass(CachingClient, [{
33
33
  key: "setCachedProfile",
34
34
  value: function setCachedProfile(cacheIdentifier, profile) {
35
- this.cache && this.cache.put(cacheIdentifier, {
35
+ this.cache && this.cache.set(cacheIdentifier, {
36
36
  expire: Date.now() + this.config.cacheMaxAge,
37
37
  profile: profile
38
38
  });
@@ -51,7 +51,7 @@ var CachingClient = /*#__PURE__*/function () {
51
51
  }
52
52
 
53
53
  if (cached.expire < Date.now()) {
54
- this.cache.remove(cacheIdentifier);
54
+ this.cache.delete(cacheIdentifier);
55
55
  return null;
56
56
  } // Extend expiry "date"
57
57
 
@@ -63,7 +63,7 @@ var CachingClient = /*#__PURE__*/function () {
63
63
  key: "flushCache",
64
64
  value: function flushCache() {
65
65
  if (this.cache) {
66
- this.cache.removeAll();
66
+ this.cache.clear();
67
67
  }
68
68
  }
69
69
  }]);
@@ -48,7 +48,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
48
48
  actionSubjectId: actionSubjectId,
49
49
  attributes: _objectSpread(_objectSpread({
50
50
  packageName: "@atlaskit/profilecard",
51
- packageVersion: "18.2.1"
51
+ packageVersion: "18.2.2"
52
52
  }, attributes), {}, {
53
53
  firedAt: Math.round(getPageTime())
54
54
  })
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "18.2.1"
3
+ "version": "18.2.2"
4
4
  }
@@ -1,4 +1,4 @@
1
- import { LRUCache } from 'lru-fast';
1
+ import { LRUMap } from 'lru_map';
2
2
  interface CachedData<T> {
3
3
  expire: number;
4
4
  profile: T;
@@ -9,7 +9,7 @@ export interface CacheConfig {
9
9
  }
10
10
  export default class CachingClient<T> {
11
11
  config: Required<CacheConfig>;
12
- cache: LRUCache<string, CachedData<T>> | null;
12
+ cache: LRUMap<string, CachedData<T>> | null;
13
13
  constructor(config: CacheConfig);
14
14
  setCachedProfile(cacheIdentifier: string, profile: T): void;
15
15
  getCachedProfile(cacheIdentifier: string): T | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "18.2.1",
3
+ "version": "18.2.2",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -56,7 +56,7 @@
56
56
  "@emotion/styled": "^11.0.0",
57
57
  "date-fns": "^2.17.0",
58
58
  "lodash": "^4.17.21",
59
- "lru-fast": "^0.2.2",
59
+ "lru_map": "^0.4.1",
60
60
  "react-intl-next": "npm:react-intl@^5.18.1"
61
61
  },
62
62
  "peerDependencies": {
package/report.api.md CHANGED
@@ -21,7 +21,7 @@ import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
21
21
  import { ComponentType } from 'react';
22
22
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
23
23
  import { IntlShape } from 'react-intl-next';
24
- import { LRUCache } from 'lru-fast';
24
+ import { LRUMap } from 'lru_map';
25
25
  import { default as React_2 } from 'react';
26
26
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
27
27
 
@@ -79,7 +79,7 @@ interface CachedData<T> {
79
79
  class CachingClient<T> {
80
80
  constructor(config: CacheConfig);
81
81
  // (undocumented)
82
- cache: LRUCache<string, CachedData<T>> | null;
82
+ cache: LRUMap<string, CachedData<T>> | null;
83
83
  // (undocumented)
84
84
  config: Required<CacheConfig>;
85
85
  // (undocumented)
@@ -10,7 +10,7 @@ import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
10
10
  import { ComponentType } from 'react';
11
11
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
12
12
  import { IntlShape } from 'react-intl-next';
13
- import { LRUCache } from 'lru-fast';
13
+ import { LRUMap } from 'lru_map';
14
14
  import { default as React_2 } from 'react';
15
15
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
16
16
 
@@ -68,7 +68,7 @@ interface CachedData<T> {
68
68
  class CachingClient<T> {
69
69
  constructor(config: CacheConfig);
70
70
  // (undocumented)
71
- cache: LRUCache<string, CachedData<T>> | null;
71
+ cache: LRUMap<string, CachedData<T>> | null;
72
72
  // (undocumented)
73
73
  config: Required<CacheConfig>;
74
74
  // (undocumented)