From 82dbd51355ea0e24c3f47a2b7acd4de78d204d5e Mon Sep 17 00:00:00 2001 From: Christoph Tavan Date: Fri, 12 Jul 2019 14:44:53 +0200 Subject: [PATCH] Use v4 UUID instead of v1 for action IDs This uses a purely random v4 UUID instead of a time-based v1 UUID for the action IDs (which were introduced in storybookjs/storybook#1347). v1 UUID are based on current time and the hardware MAC address of the machine where they are being generated (although the implementation in the npm uuid module uses generates a random fake MAC address). As such they have much more complex semantics than v4 UUIDs which are simply randomly generated. Unless there's a specific requirement for the special semantics of v1 UUIDs it is simpler and less error prone to simply go for v4 UUIDs whenever just a unique identifier is needed. --- addons/actions/src/preview/action.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/actions/src/preview/action.ts b/addons/actions/src/preview/action.ts index 1a3642325579..d9a026472de8 100644 --- a/addons/actions/src/preview/action.ts +++ b/addons/actions/src/preview/action.ts @@ -1,4 +1,4 @@ -import uuid from 'uuid/v1'; +import uuid from 'uuid/v4'; import { addons } from '@storybook/addons'; import { EVENT_ID } from '../constants'; import { ActionDisplay, ActionOptions, HandlerFunction } from '../models';