Skip to content

Remove uuid dependency#177

Merged
flozz merged 6 commits intomasterfrom
0-uuid-dependency
Apr 29, 2026
Merged

Remove uuid dependency#177
flozz merged 6 commits intomasterfrom
0-uuid-dependency

Conversation

@av-wanadev
Copy link
Copy Markdown
Contributor

As npm audit says uuid library <14 has some known vulnerabilities, we removed dependency to the uuid library. Now we use browser's secure implementation if available, or a fallback one else.

Comment thread test/spec/helpers.js
expect(photonui.Helpers.fallbackUuid4()).to.match(/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/);
});
});

Copy link
Copy Markdown
Contributor Author

@av-wanadev av-wanadev Apr 29, 2026

Choose a reason for hiding this comment

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

inspired by https://github.com/wanadev/abitbol-serializable/blob/master/test/helpers.js

It changes the regex used here, maybe double-check that

Comment thread src/helpers.js
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g, function(c) {
const r = Math.trunc(Math.random()*16), v = c == "x" ? r : (r&0x3|0x8);
return v.toString(16);
});
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread src/helpers.js Outdated
@av-wanadev av-wanadev marked this pull request as ready for review April 29, 2026 09:11
@flozz
Copy link
Copy Markdown
Member

flozz commented Apr 29, 2026

LGTM.

NOTE: breaking change on photonui.lib.uuid if someone ever use it.

@flozz flozz merged commit 44db455 into master Apr 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants