Skip to content
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

assert missing crypto.randomUUID #8301

Merged
merged 1 commit into from Nov 13, 2022

Conversation

luxzeitlos
Copy link
Contributor

Description

Add a little assert message when crypto.randomUUID does not exist

Sidenote: I was not able to test this, since I wasnt able to boot an app with the linked ember-data. :(

@runspired runspired added 🎯 canary PR is targeting canary (default) 🏷️ doc This PR adds/improves/or fixes documentation labels Nov 13, 2022
@runspired
Copy link
Contributor

Sidenote: I was not able to test this, since I wasnt able to boot an app with the linked ember-data. :(

linking usually works better with pnpm than with yarn or npm but as long as you link with whatever you are using to install in the app it should be doable. I tend to just test in the test apps though to avoid these sorts of troubles.

@@ -41,6 +41,10 @@ if (macroCondition(getOwnConfig<{ polyfillUUID: boolean }>().polyfillUUID)) {
}

function uuidv4(): string {
assert(
Copy link
Contributor

Choose a reason for hiding this comment

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

note asserts only trigger in dev build, so if deploying to an insecure environment as mentioned in https://discord.com/channels/480462759797063690/486549196837486592/1040645066504556564 the error will still be simply that randomUUID is not a function.

Copy link
Contributor

Choose a reason for hiding this comment

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

(also note, even for internal tools, if you aren't deploying production builds with https you very much should be for a host of reasons)

@runspired runspired merged commit 63e69ff into emberjs:master Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎯 canary PR is targeting canary (default) 🏷️ doc This PR adds/improves/or fixes documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants