Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Add future work section #41

Merged
merged 3 commits into from
Aug 26, 2021
Merged

Add future work section #41

merged 3 commits into from
Aug 26, 2021

Conversation

bcoe
Copy link
Collaborator

@bcoe bcoe commented Aug 25, 2021

Fix #36

@bcoe bcoe requested a review from broofa August 25, 2021 02:51
Copy link
Collaborator

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nit

README.md Outdated Show resolved Hide resolved
@bcoe bcoe merged commit 28265ed into main Aug 26, 2021
github-actions bot added a commit that referenced this pull request Aug 26, 2021
SHA: 28265ed
Reason: push, by @bcoe

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@marcoscaceres
Copy link
Collaborator

@bcoe, @domenic, I wonder if we need to start future proofing this now with an optional dictionary. Otherwise, in the future, we might have problems:

// An old browser would return a v4 uuid
// and the developer wouldn't know.
const uuid = crypto.randomUUID({ format: "v6" });

// They would need something not amazing like:

if (crypto.randomUUID.length) {
   // but you still don't know what versions are supported
}

If we added something like:

partial interface Crypto {
  [SecureContext] DOMString randomUUID(optional UUIDOptions options = {});
};

dictionary UUIDOptions  {
    UUIDFormat format = "v4"; 
 };

enum UUIDFormat { "v4" };

It also would allow developers to check if a particular format is supported.

try { 
  crypto.randomUUID({ format: "v3000" });
} catch {}

@domenic
Copy link
Collaborator

domenic commented Aug 26, 2021

I think it remains pretty unlikely there will be another random UUID format that becomes widely used enough to be worth including, but I am not a domain expert.

@marcoscaceres
Copy link
Collaborator

Ok, I'll re-play this in #36... we can gather some options there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Supporting future UUID formats
3 participants