-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use uuid for action IDs instead of Math.random (fixes #1109) #1347
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1347 +/- ##
==========================================
+ Coverage 13.75% 14.12% +0.36%
==========================================
Files 202 201 -1
Lines 4623 4609 -14
Branches 494 499 +5
==========================================
+ Hits 636 651 +15
+ Misses 3556 3524 -32
- Partials 431 434 +3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Sweet. Looks like I can't merge, I guess that happens by you guys? |
This uses a purely random v4 UUID instead of a time-based v1 UUID for the action IDs (which were introduced in storybookjs#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.
Issue: You can see the issue here: #1109
What I did
I replaced the randomly generated ID with a uuid.
How to test
I included a test, so view/run the unit test included. Or, run storybook for the actions package and you'll see that IDs are now uuids.