Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@kalamazoo/analytics-next

stevenselcuk13Apache-2.01.0.2TypeScript support: included

The 🆕 Atlaskit component analytics framework

readme

Analytics-next

Tools for tracking interactions with UI components. Easily capture UI context and state when these events occur.

Installation

yarn add @kalamazoo/analytics-next

Usage

Detailed docs and example usage can be found here.

changelog

@kalamazoo/analytics-next

6.3.4

Patch Changes

  • [patch]6940a2107f:

    Removes cycle in internal components.

6.3.3

Patch Changes

6.3.2

Patch Changes

  • [patch]768bac6d81:

    Remove redundant object check (which was previously required to appease type checking)

6.3.1

Patch Changes

  • [patch]35d2229b2a:

    Adding missing license to packages and update to Copyright 2019 Atlassian Pty Ltd.

6.3.0

Minor Changes

  • [minor]2252a7a999:

    Bug fix for using the hook with nested contexts, performance improvements, new useAnalyticsEventsCallback hook to provide a performance enhanced-abstraction for firing events with a callback.

6.2.0

Minor Changes

  • [minor]42fd897e16:

    • Introduces a new custom React hook, useAnalyticsEvents_experimental, for creating analytics events within functional components. This hook replaces the need for the withAnalyticsEvents HOC. See the Reference documentation for details on how to use this new hook.

6.1.0

Minor Changes

6.0.3

Patch Changes

  • [patch]097b696613:

    Components now depend on TS 3.6 internally, in order to fix an issue with TS resolving non-relative imports as relative imports

6.0.2

Patch Changes

6.0.1

Patch Changes

  • [patch]de35ce8c67:

    Updates component maintainers

6.0.0

Major Changes

  • [major]926b43142b:

    Analytics-next has been converted to Typescript. Typescript consumers will now get static type safety. Flow types are no longer provided. No behavioural changes.

    Breaking changes

    • withAnalyticsForSumTypeProps alias has been removed, please use withAnalyticsEvents
    • AnalyticsContextWrappedComp alias has been removed, please use withAnalyticsContext

    Breaking changes to TypeScript annotations

    • withAnalyticsEvents now infers proptypes automatically, consumers no longer need to provide props as a generic type.
    • withAnalyticsContext now infers proptypes automatically, consumers no longer need to provide props as a generic type.
    • Type WithAnalyticsEventProps has been renamed to WithAnalyticsEventsProps to match source code
    • Type CreateUIAnalyticsEventSignature has been renamed to CreateUIAnalyticsEvent to match source code
    • Type UIAnalyticsEventHandlerSignature has been renamed to UIAnalyticsEventHandler to match source code
    • Type AnalyticsEventsPayload has been renamed to AnalyticsEventPayload
    • Type ObjectType has been removed, please use Record<string, any> or [key: string]: any
    • Type UIAnalyticsEventInterface has been removed, please use UIAnalyticsEvent
    • Type AnalyticsEventInterface has been removed, please use AnalyticsEvent
    • Type CreateAndFireEventFunction removed and should now be inferred by TypeScript
    • Type AnalyticsEventUpdater removed and should now be inferred by TypeScript

5.4.1

Patch Changes

  • [patch]1439241943:

    Adding error boundary in media picker dropzone

5.4.0

Minor Changes

  • [minor]e1f8aaf33b:

    • Adding entry point for AnalyticsErrorBoundary package
    // How to use
    
    // Import via entry point
    import AnalyticsListener from '@kalamazoo/analytics-next/AnalyticsListener';
    import AnalyticsErrorBoundary from '@kalamazoo/analytics-next/AnalyticsErrorBoundary';
    
    // Wrapping your component with the component
    class ButtonWithAnalyticsErrorBoundary extends React.Component {
      handleEvent = (analyticsEvent) => {
        const { payload, context } = analyticsEvent;
        console.log('Received event:', analyticsEvent, { payload, context });
      };
    
      render() {
        return (
          <AnalyticsListener channel="atlaskit" onEvent={this.handleEvent}>
            <AnalyticsErrorBoundary
              channel="atlaskit"
              data={{
                componentName: 'button',
                packageName: '@kalamazoo/button',
                componentVersion: '999.9.9',
              }}
            >
              <Button>Click me</Button>
            </AnalyticsErrorBoundary>
          </AnalyticsListener>
        )
      }
    }

    Notes on new API:

    • Plug-and-play component. As soon and it's wrapping a component it's fully integrated.
    • It has Analytics context and events integrated already. Keep in mind it requires AnalyticsListener as a top level component to work properly, otherwise it won't trigger analytics events.

5.3.1

Patch Changes

  • [patch]281451e6dc:

    Republishing package to export AnalyticsErrorBoundaryProps

5.3.0

Minor Changes

  • [minor]ed9ae90c94:

    Adding Analytics Error Boundary component

5.2.0

Minor Changes

  • [minor]8fcbe23ec6:

    Updated types for analytics-next and buttons to make them easier to consume

5.1.3

Patch Changes

  • [patch]c6ad66d326:

    The types property in package.json now points to the correct file"

5.1.2

Patch Changes

  • [patch]9f8ab1084b:

    Consume analytics-next ts type definitions as an ambient declaration.

5.1.1

Patch Changes

  • [patch]6ea9bb7873:

    analytics-next now exports an ambient module declaration which resolves an issue with types being required via relative imports

5.1.0

Minor Changes

  • [minor]d0db01b410:

    TypeScript users of withAnalyticsEvents and withAnalyticsContext are now required to provide props as a generic type. This is so that TypeScript can correctly calculate the props and defaultProps of the returned component.

    Before:

    withAnalyticsEvents()(Button) as ComponentClass<Props>;

    After:

    withAnalyticsEvents<Props>()(Button);

5.0.2

Patch Changes

  • [patch]4615439434:

    index.ts will now be ignored when publishing to npm

5.0.1

Patch Changes

  • [patch]47acb57783:

    • Avoid unnecessary re-renders on components that use withAnalytics

5.0.0

  • [major]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:

    • @kalamazoo/analytics-next-types is deprecated. Now you can use types for @kalamazoo/analytics-next supplied from itself.

4.0.4

  • [patch]9321da655d:

    • Update AnalyticsEventMap, as per major inline edit rewrite

4.0.3

4.0.2

  • [patch]98e11001ff:

    • Removes duplicate babel-runtime dependency

4.0.1

4.0.0

  • [major]76299208e6:

    • Drop ES5 from all the flow modules

    Dropping CJS support in all @atlaskit packages

    As a breaking change, all @atlaskit packages will be dropping cjs distributions and will only distribute esm. This means all distributed code will be transpiled, but will still contain import and export declarations.

    The major reason for doing this is to allow us to support multiple entry points in packages, e.g:

    import colors from `@kalamazoo/theme/colors`;

    Previously this was sort of possible for consumers by doing something like:

    import colors from `@kalamazoo/theme/dist/esm/colors`;

    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.

    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.

    ES Modules are widely supported by all modern bundlers and can be worked around in node environments.

    We may choose to revisit this solution in the future if we find any unintended condequences, but we see this as a pretty sane path forward which should lead to some major bundle size decreases, saner API's and simpler package architecture.

    Please reach out to #fabric-build (if in Atlassian) or create an issue in Design System Support (for external) if you have any questions or queries about this.

3.2.1

  • [patch]8de4c3f:

    • Added missing export

3.2.0

  • [minor]c3fa0b6:

    • Added support for props of Sum type

3.1.2

3.1.1

3.1.0

  • [minor]cffeed0:

    • Type withAnalyticsEvents and withAnalyticsContext HOCs so that they do not lose flow types of the components they wrap when chained together.

      This will fix flow types not flowing through all of the components that we have instrumented with analytics as they are typically wrapped with both HOCs. To get flow types flowing through your components again, upgrade them to the latest version and also update their @kalamazoo/analytics-next dependency to the latest version.

      We also now export AnalyticsContextWrappedComp and AnalyticsEventsWrappedComp parameterised types that allow you to explicitly type components wrapped with these HOCs which is necessary in cases where the HOC wrapping is extracted into another function.

3.0.11

  • [patch]d903ab5:

    • Updates list of instrumented components

3.0.10

  • [patch] Adds missing implicit @babel/runtime dependency b71751b

3.0.9

  • [patch] adds missing babel-runtime dependency to package json 93b031a

3.0.8

  • [patch] Fixing analytics events for checkbox/radio/select 3e428e3

3.0.7

  • [patch] Loosen AnalyticsEventPayload type to cater for Screen events 2d4b52e

3.0.5

  • [patch] Loosen AnalyticsEventCreator return type f7432a2
  • [none] Updated dependencies f7432a2

3.0.4

3.0.3

3.0.2

3.0.1

3.0.0

2.1.9

  • [patch] removes requirement of children to be a single React node 53cba6b
  • [none] Updated dependencies 53cba6b

2.1.8

2.1.7

2.1.6

  • [patch] Unpublish fake TS declaration file ec9f11f
  • [none] Updated dependencies ec9f11f

2.1.5

2.1.4

2.1.3

  • [patch] Removed ambient typescript type declaration file from analytics-next - this may be a breaking change for typescript consumers 290d804
  • [none] Updated dependencies 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
  • [none] Updated dependencies 586a80c

2.1.1

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

2.0.0

  • [major] Bump to React 16.3. 4251858

1.1.10

  • [patch] Adjusted exports to prevent attempted exporting of flow types in built code. 183ee96

1.1.9

  • [patch] Updates flow types of withAnalyticsEvents and withAnalyticsContext HOCs 26778bc
  • [patch] Uses element config flow type with button deprecation warnings hoc a9aa90a

1.1.8

  • [patch] Add "sideEffects: false" to AKM2 packages to allow consumer's to tree-shake c3b018a

1.1.7

  • [patch] Fix/revert TS TDs in analytics-next 1284d32

1.1.6

  • [patch] Fix analytics-next TS type definition 9faaa5f
  • [patch] Fix analytics-next TS type definition 7e26229

1.1.5

  • [patch] Add analytics events for click and show actions of media-card 031d5da
  • [patch] Add analytics events for click and show actions of media-card b361185

1.1.4

  • [patch] fixes problem with withAnalyticsEvents HOC passing old function props to wrapped component c88b030

1.1.3

  • [patch] adds displayName to analytics HOCs f69ccad

1.1.2

  • [patch] Re-releasing due to potentially broken babel release 9ed0bba

1.1.1

  • [patch] Remove min requirement of node 8 for analytics-next c864671

1.1.0

  • [minor] adds createAndFireEvent utility method and updates docs 24a93fc

1.0.3

  • [patch] fixes flow type problem with wrapping stateless functional components in withAnalyticsEvents 8344ffb

1.0.2

  • [patch] Adds action key to analytics payload type 7deeaef

1.0.1

1.0.0

  • [major] release @kalamazoo/analytics-next package 80695ea