-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
refactor!: remove uuid and rand dependencies where applicable #7939
Conversation
it's used so that it's unpredictable and because the output chars are always valid as a schema suffix. using i've noticed some code that used uuid is replaced with smaller sizes of things, so take care that it's not problematic there. uuid v4 are often used as trusted random unique numbers because they are 128 bytes (well 122 since some are fixed) that you don't need to check for collisions for in most applications because it's so incredibly unlikely to get another of the same. u32s are much more likely to collide some places they have been replaced with constants (like the event listener object and function names) which was seen as undesirable before to discourage people from using it manually and going through the proper api instead. |
I will leave that one using uuid for now, at least it is only active when using isolation pattern and the main goal for this PR was to remove it from public API.
the u32s are only incrementing so it shouldn't collide with itself, there maybe other ids that could have the same value but they are used in other places.
Yeah, I wasn't aware of the history behind that, I could use |
just to avoid the typical "spacebar heating" problem if the behavior does change - and we should explicitly mark somewhere that it is unstable |
could change the const from function_name: "_listeners_function_id_",
object_name: "_listeners_object_id_", to function_name: "_internal_listeners_function_id_",
object_name: "_internal_listeners_object_id_", |
ref: #7756
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Checklist
fix: remove a typo, closes #___, #___
)Other information