Add a library for generating secure random strings on web, so we can use it for creating unique
device ID.
The library: https://www.npmjs.com/package/crypto-random-string / https://classic.yarnpkg.com/en/package/crypto-random-string
Linear issue: https://linear.app/comm/issue/ENG-1279/initialize-deviceid-on-clients
Details
Details
Check that everything still compiles.
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Branch
- inka/add_library
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Comment Actions
Seems good!! Two quick questions:
- In the docs, crypto.randomBytes is mentioned, which is a function in the Node.js API that is not in the browser API. How does crypto-random-string get access to the crypto module on web? I'm wondering if it's being "polyfilled".
- Related to the above, what is the "bundle size" impact of crypto-random-string? You can run cd web && yarn prod before and after this change and see how much larger the resultant .cjs file is. The reason I ask is that I'm worried that if this library is "polyfilling" the whole crypto module from Node.js, it may have a large impact on the bundle size.