Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This pull request migrates the export iframe from a standalone HTML/JS approach to a webpack-based build system, modernizing the codebase and improving modularity. The changes align the export iframe with the existing webpack-based architecture used by other iframes in the project (import and export-and-sign).
Changes:
- Introduced webpack build configuration with Babel transpilation, CSS extraction, and code splitting
- Added support for Bitcoin WIF and Sui Bech32 key encoding formats to shared turnkey-core module
- Restructured export iframe code into modular ES6 imports with separate CSS and HTML templates
- Updated build pipeline in Dockerfile to compile export iframe alongside other webpack-based modules
Reviewed changes
Copilot reviewed 13 out of 30 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| shared/turnkey-core.js | Added base58CheckEncode function and new key encoding formats (BITCOIN_MAINNET_WIF, BITCOIN_TESTNET_WIF, SUI_BECH32) to support additional blockchain ecosystems |
| nginx.conf | Updated export iframe routing configuration to serve webpack-built assets |
| export/webpack.config.js | New webpack configuration with Babel, CSS extraction, CSP settings, and code splitting |
| export/src/turnkey-core.js | New module that wraps and re-exports shared functions with export-specific utilities |
| export/src/styles.css | Extracted CSS styles from inline HTML to separate stylesheet |
| export/src/index.template.html | Clean HTML template without embedded JavaScript |
| export/src/index.js | New entry point with modularized event handlers and HPKE decryption logic |
| export/package.json | Added webpack toolchain dependencies and updated build scripts |
| export/noble-ed25519.js | Removed vendored library in favor of npm package |
| export/index.test.js | Updated test setup to work with new modular structure |
| export/index.template.html | Removed monolithic HTML file with embedded scripts |
| Dockerfile | Added export module build step to multi-stage build process |
| dist/* | Generated webpack build artifacts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| server { | ||
| listen 8081; | ||
| root /usr/share/nginx; | ||
| root /usr/share/nginx/templated/export; |
There was a problem hiding this comment.
The nginx configuration sets the root to /usr/share/nginx/templated/export, but the Dockerfile copies the built export files to /usr/share/nginx/export (line 41). This path mismatch will cause nginx to fail serving the export iframe. Either change the Dockerfile to copy to /usr/share/nginx/templated/export or update this nginx root directive to /usr/share/nginx/export.
| root /usr/share/nginx/templated/export; | |
| root /usr/share/nginx/export; |
ed8c91c to
0ada54c
Compare
0ada54c to
b6402c6
Compare
|
I believe we will need to update the |
|
I would make sure the github actions for export-and-sign match export and re-run the CI build after the change. I believe there will be more errors and things we missed that will be uncovered: .github/workflows/ci.yml |
| <!DOCTYPE html> | ||
| <html class="no-js" lang=""> | ||
| <head> | ||
| <link rel="icon" type="image/svg+xml" href="./favicon.svg" /> |
There was a problem hiding this comment.
We are going to need something like this or else we will get an error in preprod and production:
https://github.com/tkhq/frames/blob/main/export-and-sign/src/index.template.html#L8
verifyEnclaveSignature will always throw in production
| resolveLoader: { | ||
| modules: [path.resolve(__dirname, "node_modules"), "node_modules"], | ||
| }, | ||
| optimization: { |
There was a problem hiding this comment.
We will need to add deterministic in the optimization as well.
| optimization: { | |
| optimization: { | |
| // Reproducible builds so CI "dist matches committed" check passes | |
| moduleIds: "deterministic", | |
| chunkIds: "deterministic", |
| }, | ||
| "dependencies": { | ||
| "@hpke/core": "^1.7.5", | ||
| "@noble/ed25519": "^3.0.0", |
There was a problem hiding this comment.
Not sure if this matters, but export is running version 3.0.0 for this package while export-and-sign is running 2.0.0: https://github.com/tkhq/frames/blob/main/export-and-sign/package.json#L22
Another NIT:
We have carats as part of these dependencies while export-and-sign have the packages locked.
| @@ -0,0 +1,320 @@ | |||
| // Vendor @hpke/core from https://esm.sh/@hpke/core@1.2.7 | |||
There was a problem hiding this comment.
We can remove this comment since it's managed by webpack
| keyDiv.style[styleKey] = style[styleKey]; | ||
| } | ||
| document.body.appendChild(keyDiv); | ||
| TKHQ.applySettings(TKHQ.getSettings()); |
There was a problem hiding this comment.
we call applySettings here, but we don't in standalone.js. Do you know the reason why? I'm not sure if it is testing something or not: https://github.com/tkhq/frames/pull/114/changes#diff-1c20a0aebf2920f0209e01ecd1b5ef3cdf3739d0209015550ef3f0a18b83ba9cR156
No description provided.