@atlaskit/analytics-next
Advanced tools
Comparing version 5.0.0 to 5.0.1
[ | ||
{ | ||
"team": "core", | ||
"package": "@atlaskit/analytics-next", | ||
"version": "5.0.0", | ||
"dependent": true, | ||
"id": "src.main", | ||
"name": "main", | ||
"stats": { | ||
"size": 6648, | ||
"gzipSize": 2178 | ||
"size": 7424, | ||
"gzipSize": 2357 | ||
} | ||
}, | ||
{ | ||
"team": "core", | ||
"package": "@atlaskit/analytics-next", | ||
"version": "5.0.0", | ||
"dependent": true, | ||
"id": "node_modules.main", | ||
@@ -15,13 +23,17 @@ "name": "node_modules [main]", | ||
"size": 3814, | ||
"gzipSize": 1255 | ||
"gzipSize": 1256 | ||
} | ||
}, | ||
{ | ||
"team": "core", | ||
"package": "@atlaskit/analytics-next", | ||
"version": "5.0.0", | ||
"dependent": true, | ||
"id": "combined.main", | ||
"name": "main", | ||
"stats": { | ||
"size": 9848, | ||
"gzipSize": 2900 | ||
"size": 10624, | ||
"gzipSize": 3077 | ||
} | ||
} | ||
] |
# @atlaskit/analytics-next | ||
## 5.0.1 | ||
### Patch Changes | ||
- [patch][47acb57783](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/47acb57783): | ||
- Avoid unnecessary re-renders on components that use withAnalytics | ||
## 5.0.0 | ||
- [major] [7c17b35107](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/7c17b35107): | ||
- [major][7c17b35107](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/7c17b35107): | ||
- Updates react and react-dom peer dependencies to react@^16.8.0 and react-dom@^16.8.0. To use this package, please ensure you use at least this version of react and react-dom. | ||
## 4.0.5 | ||
- [patch] [3f28e6443c](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/3f28e6443c): | ||
- [patch][3f28e6443c](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/3f28e6443c): | ||
- @atlaskit/analytics-next-types is deprecated. Now you can use types for @atlaskit/analytics-next supplied from itself. | ||
## 4.0.4 | ||
- [patch] [9321da655d](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/9321da655d): | ||
- [patch][9321da655d](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/9321da655d): | ||
- Update AnalyticsEventMap, as per major inline edit rewrite | ||
## 4.0.3 | ||
- Updated dependencies [1e826b2966](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/1e826b2966): | ||
@@ -25,7 +37,9 @@ - @atlaskit/docs@7.0.2 | ||
## 4.0.2 | ||
- [patch] [98e11001ff](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/98e11001ff): | ||
- [patch][98e11001ff](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/98e11001ff): | ||
- Removes duplicate babel-runtime dependency | ||
## 4.0.1 | ||
- Updated dependencies [9d5cc39394](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/9d5cc39394): | ||
@@ -37,4 +51,5 @@ - @atlaskit/docs@7.0.1 | ||
## 4.0.0 | ||
- [major] [76299208e6](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/76299208e6): | ||
- [major][76299208e6](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/76299208e6): | ||
- Drop ES5 from all the flow modules | ||
@@ -59,3 +74,3 @@ | ||
This has a couple of issues. 1, it treats the file system as API making internal refactors harder, we have to worry about how consumers might be using things that aren't *actually* supposed to be used. 2. We are unable to do this *internally* in @atlaskit packages. This leads to lots of packages bundling all of theme, just to use a single color, especially in situations where tree shaking fails. | ||
This has a couple of issues. 1, it treats the file system as API making internal refactors harder, we have to worry about how consumers might be using things that aren't _actually_ supposed to be used. 2. We are unable to do this _internally_ in @atlaskit packages. This leads to lots of packages bundling all of theme, just to use a single color, especially in situations where tree shaking fails. | ||
@@ -71,12 +86,15 @@ To support being able to use multiple entrypoints internally, we unfortunately cannot have multiple distributions as they would need to have very different imports from of their own internal dependencies. | ||
## 3.2.1 | ||
- [patch] [8de4c3f](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/8de4c3f): | ||
- [patch][8de4c3f](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/8de4c3f): | ||
- Added missing export | ||
## 3.2.0 | ||
- [minor] [c3fa0b6](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/c3fa0b6): | ||
- [minor][c3fa0b6](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/c3fa0b6): | ||
- Added support for props of Sum type | ||
## 3.1.2 | ||
- Updated dependencies [58b84fa](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/58b84fa): | ||
@@ -88,2 +106,3 @@ - @atlaskit/button@10.1.1 | ||
## 3.1.1 | ||
- Updated dependencies [6998f11](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/6998f11): | ||
@@ -95,4 +114,5 @@ - @atlaskit/docs@5.2.1 | ||
## 3.1.0 | ||
- [minor] [cffeed0](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/cffeed0): | ||
- [minor][cffeed0](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/cffeed0): | ||
- Type `withAnalyticsEvents` and `withAnalyticsContext` HOCs so that they do not lose flow types of the components they wrap when chained together. | ||
@@ -106,19 +126,25 @@ | ||
## 3.0.11 | ||
- [patch] [d903ab5](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/d903ab5): | ||
- [patch][d903ab5](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/d903ab5): | ||
- Updates list of instrumented components | ||
## 3.0.10 | ||
- [patch] Adds missing implicit @babel/runtime dependency [b71751b](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/b71751b) | ||
## 3.0.9 | ||
- [patch] adds missing babel-runtime dependency to package json [93b031a](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/93b031a) | ||
## 3.0.8 | ||
- [patch] Fixing analytics events for checkbox/radio/select [3e428e3](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/3e428e3) | ||
## 3.0.7 | ||
- [patch] Loosen AnalyticsEventPayload type to cater for Screen events [2d4b52e](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/2d4b52e) | ||
## 3.0.5 | ||
- [patch] Loosen AnalyticsEventCreator return type [f7432a2](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/f7432a2) | ||
@@ -128,2 +154,3 @@ - [none] Updated dependencies [f7432a2](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/f7432a2) | ||
## 3.0.4 | ||
- [patch] update the dependency of react-dom to 16.4.2 due to vulnerability in previous versions read https://reactjs.org/blog/2018/08/01/react-v-16-4-2.html for details [a4bd557](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/a4bd557) | ||
@@ -135,2 +162,3 @@ - [none] Updated dependencies [a4bd557](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/a4bd557) | ||
## 3.0.3 | ||
- [patch] Updated dependencies [acd86a1](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/acd86a1) | ||
@@ -142,2 +170,3 @@ - @atlaskit/button@9.0.4 | ||
## 3.0.2 | ||
- [patch] Add a SSR test for every package, add react-dom and build-utils in devDependencies [7e331b5](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/7e331b5) | ||
@@ -149,2 +178,3 @@ - [none] Updated dependencies [7e331b5](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/7e331b5) | ||
## 3.0.1 | ||
- [patch] Move analytics tests and replace elements to core [49d4ab4](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/49d4ab4) | ||
@@ -169,2 +199,3 @@ - [none] Updated dependencies [49d4ab4](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/49d4ab4) | ||
## 2.1.9 | ||
- [patch] removes requirement of children to be a single React node [53cba6b](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/53cba6b) | ||
@@ -174,2 +205,3 @@ - [none] Updated dependencies [53cba6b](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/53cba6b) | ||
## 2.1.8 | ||
- [patch] Update changelogs to remove duplicate [cc58e17](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/cc58e17) | ||
@@ -181,2 +213,3 @@ - [none] Updated dependencies [cc58e17](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/cc58e17) | ||
## 2.1.7 | ||
- [none] Updated dependencies [9d20f54](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/9d20f54) | ||
@@ -188,2 +221,3 @@ - @atlaskit/docs@4.1.0 | ||
## 2.1.6 | ||
- [patch] Unpublish fake TS declaration file [ec9f11f](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/ec9f11f) | ||
@@ -193,2 +227,3 @@ - [none] Updated dependencies [ec9f11f](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/ec9f11f) | ||
## 2.1.5 | ||
- [patch] Update readme's [223cd67](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/223cd67) | ||
@@ -201,2 +236,3 @@ - [patch] Updated dependencies [223cd67](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/223cd67) | ||
## 2.1.4 | ||
- [patch] Updated dependencies [1e80619](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/1e80619) | ||
@@ -208,2 +244,3 @@ - @atlaskit/field-text@6.0.0 | ||
## 2.1.3 | ||
- [patch] Removed ambient typescript type declaration file from analytics-next - this may be a breaking change for typescript consumers [290d804](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/290d804) | ||
@@ -213,2 +250,3 @@ - [none] Updated dependencies [290d804](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/290d804) | ||
## 2.1.2 | ||
- [patch] Fix prop callbacks specified in the create event map to not change reference values each render and instead only update when the original prop callback changes [586a80c](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/586a80c) | ||
@@ -218,2 +256,3 @@ - [none] Updated dependencies [586a80c](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/586a80c) | ||
## 2.1.1 | ||
- [patch] Updated dependencies [d662caa](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/d662caa) | ||
@@ -225,11 +264,15 @@ - @atlaskit/field-text@5.0.3 | ||
## 2.1.0 | ||
- [minor] Export cleanProps function that can be used to strip analytics props provided by our HOCs, useful when spreading props to a child element [973d6ea](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/973d6ea) | ||
## 2.0.0 | ||
- [major] Bump to React 16.3. [4251858](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/4251858) | ||
## 1.1.10 | ||
- [patch] Adjusted exports to prevent attempted exporting of flow types in built code. [183ee96](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/183ee96) | ||
## 1.1.9 | ||
- [patch] Updates flow types of withAnalyticsEvents and withAnalyticsContext HOCs [26778bc](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/26778bc) | ||
@@ -239,8 +282,11 @@ - [patch] Uses element config flow type with button deprecation warnings hoc [a9aa90a](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/a9aa90a) | ||
## 1.1.8 | ||
- [patch] Add "sideEffects: false" to AKM2 packages to allow consumer's to tree-shake [c3b018a](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/c3b018a) | ||
## 1.1.7 | ||
- [patch] Fix/revert TS TDs in analytics-next [1284d32](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/1284d32) | ||
## 1.1.6 | ||
- [patch] Fix analytics-next TS type definition [9faaa5f](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/9faaa5f) | ||
@@ -250,2 +296,3 @@ - [patch] Fix analytics-next TS type definition [7e26229](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/7e26229) | ||
## 1.1.5 | ||
- [patch] Add analytics events for click and show actions of media-card [031d5da](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/031d5da) | ||
@@ -255,26 +302,35 @@ - [patch] Add analytics events for click and show actions of media-card [b361185](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/b361185) | ||
## 1.1.4 | ||
- [patch] fixes problem with withAnalyticsEvents HOC passing old function props to wrapped component [c88b030](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/c88b030) | ||
## 1.1.3 | ||
- [patch] adds displayName to analytics HOCs [f69ccad](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/f69ccad) | ||
## 1.1.2 | ||
- [patch] Re-releasing due to potentially broken babel release [9ed0bba](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/9ed0bba) | ||
## 1.1.1 | ||
- [patch] Remove min requirement of node 8 for analytics-next [c864671](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/c864671) | ||
## 1.1.0 | ||
- [minor] adds createAndFireEvent utility method and updates docs [24a93fc](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/24a93fc) | ||
## 1.0.3 | ||
- [patch] fixes flow type problem with wrapping stateless functional components in withAnalyticsEvents [8344ffb](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/8344ffb) | ||
## 1.0.2 | ||
- [patch] Adds action key to analytics payload type [7deeaef](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/7deeaef) | ||
## 1.0.1 | ||
- [patch] updated the repository url to https://bitbucket.org/atlassian/atlaskit-mk-2 [1e57e5a](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/1e57e5a) | ||
## 1.0.0 | ||
- [major] release @atlaskit/analytics-next package [80695ea](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/80695ea) |
{ | ||
"name": "@atlaskit/analytics-next", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"sideEffects": false | ||
} |
{ | ||
"name": "@atlaskit/analytics-next", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "The 🆕 Atlaskit component analytics framework", | ||
@@ -32,3 +32,3 @@ "license": "Apache-2.0", | ||
"@atlaskit/button": "^13.0.0", | ||
"@atlaskit/docs": "^8.0.0", | ||
"@atlaskit/docs": "^8.1.1", | ||
"@atlaskit/field-text": "^9.0.0", | ||
@@ -38,6 +38,5 @@ "@atlaskit/ssr": "^0.1.0", | ||
"enzyme": "^3.7.0", | ||
"lodash.isequal": "^4.5.0", | ||
"react-dom": "^16.8.0", | ||
"redux": "^3.7.2" | ||
} | ||
} | ||
} |
{ | ||
"name": "@atlaskit/analytics-next", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"sideEffects": false | ||
} |
import _extends from "@babel/runtime/helpers/extends"; | ||
import _typeof from "@babel/runtime/helpers/typeof"; | ||
import _objectSpread from "@babel/runtime/helpers/objectSpread"; | ||
@@ -22,5 +23,5 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; | ||
function AnalyticsContextConsumer() { | ||
var _getPrototypeOf2; | ||
// Store references to the original and patched event props so we can determine when to update | ||
// the patched props | ||
function AnalyticsContextConsumer(_props) { | ||
var _this; | ||
@@ -30,8 +31,48 @@ | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
_this = _possibleConstructorReturn(this, _getPrototypeOf(AnalyticsContextConsumer).call(this, _props)); | ||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(AnalyticsContextConsumer)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
_defineProperty(_assertThisInitialized(_this), "originalEventProps", {}); | ||
_defineProperty(_assertThisInitialized(_this), "patchedEventProps", {}); | ||
_defineProperty(_assertThisInitialized(_this), "updatePatchedEventProps", function (props) { | ||
var changedPropCallbacks = Object.keys(_this.props.createEventMap).filter(function (p) { | ||
return _this.originalEventProps[p] !== props[p]; | ||
}); | ||
if (changedPropCallbacks.length > 0) { | ||
_this.patchedEventProps = _objectSpread({}, _this.patchedEventProps, _this.mapCreateEventsToProps(changedPropCallbacks, props)); | ||
changedPropCallbacks.forEach(function (p) { | ||
_this.originalEventProps[p] = props[p]; | ||
}); | ||
} | ||
return _this.patchedEventProps; | ||
}); | ||
_defineProperty(_assertThisInitialized(_this), "mapCreateEventsToProps", function (changedPropNames, props) { | ||
return changedPropNames.reduce(function (modified, propCallbackName) { | ||
var eventCreator = _this.props.createEventMap[propCallbackName]; | ||
var providedCallback = props[propCallbackName]; | ||
if (!['object', 'function'].includes(_typeof(eventCreator))) { | ||
return modified; | ||
} | ||
var modifiedCallback = function modifiedCallback() { | ||
var analyticsEvent = typeof eventCreator === 'function' ? eventCreator(_this.createAnalyticsEvent, props) : _this.createAnalyticsEvent(eventCreator); | ||
if (providedCallback) { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
providedCallback.apply(void 0, args.concat([analyticsEvent])); | ||
} | ||
}; | ||
return _objectSpread({}, modified, _defineProperty({}, propCallbackName, modifiedCallback)); | ||
}, {}); | ||
}); | ||
_defineProperty(_assertThisInitialized(_this), "createAnalyticsEvent", function (payload) { | ||
@@ -50,9 +91,18 @@ var _this$context = _this.context, | ||
Object.keys(_this.props.createEventMap).forEach(function (p) { | ||
_this.originalEventProps[p] = _props.wrappedComponentProps[p]; | ||
}); | ||
_this.patchedEventProps = _this.mapCreateEventsToProps(Object.keys(_this.props.createEventMap), _props.wrappedComponentProps); | ||
return _this; | ||
} | ||
} // Update patched event props only if the original props have changed | ||
_createClass(AnalyticsContextConsumer, [{ | ||
key: "render", | ||
value: function render() { | ||
return this.props.children(this.createAnalyticsEvent); | ||
var patchedEventProps = this.updatePatchedEventProps(this.props.wrappedComponentProps); | ||
return this.props.children({ | ||
createAnalyticsEvent: this.createAnalyticsEvent, | ||
patchedEventProps: patchedEventProps | ||
}); | ||
} | ||
@@ -62,5 +112,4 @@ }]); | ||
return AnalyticsContextConsumer; | ||
}(Component); // patch the callback so it provides analytics information. | ||
}(Component); | ||
_defineProperty(AnalyticsContextConsumer, "contextTypes", { | ||
@@ -71,30 +120,6 @@ getAtlaskitAnalyticsEventHandlers: PropTypes.func, | ||
var modifyCallbackProp = function modifyCallbackProp(propName, eventMapEntry, props, createAnalyticsEvent) { | ||
return function () { | ||
var event = typeof eventMapEntry === 'function' ? eventMapEntry(createAnalyticsEvent, props) : createAnalyticsEvent(eventMapEntry); | ||
var providedCallback = props[propName]; | ||
_defineProperty(AnalyticsContextConsumer, "defaultProps", { | ||
createEventMap: {} | ||
}); | ||
if (providedCallback) { | ||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
args[_key2] = arguments[_key2]; | ||
} | ||
providedCallback.apply(void 0, args.concat([event])); | ||
} | ||
}; | ||
}; | ||
// helper that provides an easy way to map an object's values | ||
// ({ string: A }, (string, A) => B) => { string: B } | ||
var vmap = function vmap(obj, fn) { | ||
return Object.keys(obj).reduce(function (curr, k) { | ||
return _objectSpread({}, curr, _defineProperty({}, k, fn(k, obj[k]))); | ||
}, {}); | ||
}; | ||
/* This must use $Supertype to work with multiple HOCs - https://github.com/facebook/flow/issues/6057#issuecomment-414157781 | ||
* We also cannot alias this as a generic of withAnalyticsEvents itself as | ||
* that causes issues with multiple HOCs - https://github.com/facebook/flow/issues/6587 | ||
*/ | ||
export default function withAnalyticsEvents() { | ||
@@ -105,7 +130,9 @@ var createEventMap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var WithAnalyticsEvents = React.forwardRef(function (props, ref) { | ||
return React.createElement(AnalyticsContextConsumer, null, function (createAnalyticsEvent) { | ||
var modifiedProps = vmap(createEventMap, function (propName, entry) { | ||
return modifyCallbackProp(propName, entry, props, createAnalyticsEvent); | ||
}); | ||
return React.createElement(WrappedComponent, _extends({}, props, modifiedProps, { | ||
return React.createElement(AnalyticsContextConsumer, { | ||
createEventMap: createEventMap, | ||
wrappedComponentProps: props | ||
}, function (_ref) { | ||
var createAnalyticsEvent = _ref.createAnalyticsEvent, | ||
patchedEventProps = _ref.patchedEventProps; | ||
return React.createElement(WrappedComponent, _extends({}, props, patchedEventProps, { | ||
createAnalyticsEvent: createAnalyticsEvent, | ||
@@ -112,0 +139,0 @@ ref: ref |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108447
9
1629