Use uuid for action IDs instead of Math.random (fixes #1109)#1347
Merged
shilman merged 3 commits intostorybookjs:masterfrom Jun 26, 2017
Merged
Use uuid for action IDs instead of Math.random (fixes #1109)#1347shilman merged 3 commits intostorybookjs:masterfrom
shilman merged 3 commits intostorybookjs:masterfrom
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.
|
Contributor
Author
|
Sweet. Looks like I can't merge, I guess that happens by you guys? |
ctavan
added a commit
to ctavan/storybook
that referenced
this pull request
Jul 12, 2019
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.