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

Improve random int #14828

Closed
wants to merge 2 commits into from
Closed

Improve random int #14828

wants to merge 2 commits into from

Conversation

peter-sanderson
Copy link
Contributor

@peter-sanderson peter-sanderson commented Oct 14, 2024

@@ -44,7 +44,7 @@ const config: webpack.Configuration = {
src: path.resolve(__dirname, '../../suite/src/'),
},
fallback: {
// Polyfills crypto API for NodeJS libraries in the browser. 'crypto' does not run without 'stream'
// Polyfills crypto API for Node.js libraries in the browser. 'crypto' does not run without 'stream'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I received a notice, that this is the official™ spelling is Node.js. 🤷

@peter-sanderson peter-sanderson force-pushed the improve-random-int branch 3 times, most recently from db025fb to 61d28fc Compare October 14, 2024 14:29
@peter-sanderson peter-sanderson force-pushed the improve-random-int branch 2 times, most recently from 13b1c56 to 299bc68 Compare October 15, 2024 10:38
@@ -14,7 +14,7 @@
"test:e2e:new-bridge:hw": "USE_HW=true USE_NODE_BRIDGE=true yarn test:e2e:bridge",
"test:e2e:new-bridge:emu": "USE_HW=false USE_NODE_BRIDGE=true yarn test:e2e:bridge",
"build:e2e:api:node": "yarn esbuild ./e2e/api/api.test.ts --bundle --outfile=./e2e/dist/api.test.node.js --platform=node --target=node18 --external:usb",
"build:e2e:api:browser": "yarn esbuild ./e2e/api/api.test.ts --bundle --outfile=./e2e/dist/api.test.browser.js --platform=browser --external:usb && cp e2e/ui/api.test.html e2e/dist/index.html",
"build:e2e:api:browser": "yarn esbuild ./e2e/api/api.test.ts --bundle --alias:crypto=crypto-browserify --alias:stream=stream-browserify --outfile=./e2e/dist/api.test.browser.js --platform=browser --external:usb && cp e2e/ui/api.test.html e2e/dist/index.html",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Took me a while to figure this out: https://esbuild.github.io/api/#alias

@@ -45,7 +45,8 @@
"dependencies": {
"@trezor/connect": "workspace:*",
"@trezor/connect-common": "workspace:*",
"@trezor/utils": "workspace:*"
"@trezor/utils": "workspace:*",
"crypto-browserify": "^3.12.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

dependency or devDependency ? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It depends... 🤣

Copy link
Contributor

Choose a reason for hiding this comment

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

it should, imho, be only devDependency. because we only need it to produce lib using build:lib. it shouldn't be needed in the runtime of this package at all I believe.

Copy link
Contributor

Choose a reason for hiding this comment

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

connect-web itself only imports scheduleAction, createDeferred and createDeferredManager

@@ -25,6 +25,7 @@
"@trezor/device-utils": "workspace:*",
"@trezor/transport": "workspace:*",
"@trezor/urls": "workspace:*",
"crypto-browserify": "^3.12.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

and what about stream-browserify. this is transient?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, I used the same approach as was in suite package

@peter-sanderson
Copy link
Contributor Author

=> #14878

@peter-sanderson peter-sanderson deleted the improve-random-int branch October 15, 2024 12:26
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