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

chore(transport-bridge): simplify ui #17448

Merged
merged 1 commit into from
Mar 6, 2025
Merged

Conversation

mroz22
Copy link
Contributor

@mroz22 mroz22 commented Mar 6, 2025

Description

Related Issue

Resolve

Screenshots:

@mroz22 mroz22 force-pushed the transport-bridge-chores branch from cae3d7c to 3ef7cd5 Compare March 6, 2025 14:26
@mroz22 mroz22 changed the title `chore(transport-bridge): simplify ui chore(transport-bridge): simplify ui Mar 6, 2025
@mroz22 mroz22 added the no-project This label is used to specify that PR doesn't need to be added to a project label Mar 6, 2025
@mroz22 mroz22 force-pushed the transport-bridge-chores branch from 3ef7cd5 to 6b1edd4 Compare March 6, 2025 14:35
Copy link

github-actions bot commented Mar 6, 2025

🚀 Expo preview is ready!

  • Project → trezor-suite-preview
  • Platforms → android, ios
  • Scheme → trezorsuitelite
  • Runtime Version → 26
  • More info

Learn more about 𝝠 Expo Github Action

@mroz22 mroz22 marked this pull request as ready for review March 6, 2025 14:40
@mroz22 mroz22 enabled auto-merge (rebase) March 6, 2025 14:40
Copy link

coderabbitai bot commented Mar 6, 2025

Walkthrough

The pull request updates the transport-bridge package by introducing a new development dependency, "html-inline-script-webpack-plugin", in both the package.json and the dependency list. Additionally, the HTTP server configuration has been modified by removing the route handler for the /ui endpoint, which was responsible for serving UI assets. The Webpack configuration has also been revised to include the new plugin while removing specific properties (filename and publicPath) from the HtmlWebpackPlugin settings. These changes adjust the asset handling and bundling process without altering the overall structure of the remaining code.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83808a4 and 6b1edd4.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (4)
  • packages/transport-bridge/package.json (1 hunks)
  • packages/transport-bridge/src/http.ts (0 hunks)
  • packages/transport-bridge/webpack/ui.webpack.config.ts (2 hunks)
  • scripts/list-outdated-dependencies/connect-dependencies.txt (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/transport-bridge/src/http.ts
✅ Files skipped from review due to trivial changes (1)
  • scripts/list-outdated-dependencies/connect-dependencies.txt
⏰ Context from checks skipped due to timeout of 90000ms (14)
  • GitHub Check: e2e-test-suite-web (@group=other)
  • GitHub Check: e2e-test-suite-web (@group=metadata2)
  • GitHub Check: e2e-test-suite-web (@group=metadata1)
  • GitHub Check: Type Checking
  • GitHub Check: Unit Tests
  • GitHub Check: PR-check / node-authorizeCoinjoin cancelCoinjoinAuthorization passphrase unlockPath setBusy checkFirmwareAuthenticity keepSession cancel.test info.test resetDevice-api
  • GitHub Check: build-deploy
  • GitHub Check: run-desktop-tests (@group=wallet, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=passphrase, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=settings, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=device-management, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=suite, trezor-user-env-unix)
  • GitHub Check: Analyze with CodeQL (javascript)
  • GitHub Check: test
🔇 Additional comments (4)
packages/transport-bridge/package.json (1)

24-24: New dependency added to support UI simplification.

This new dev dependency will enable inlining JavaScript directly into HTML files rather than serving them as separate assets, which aligns with the PR objective of simplifying the UI.

packages/transport-bridge/webpack/ui.webpack.config.ts (3)

1-1: New import to support UI simplification.

The HtmlInlineScriptPlugin will allow JavaScript to be embedded directly into the HTML output.


64-67: Configuration simplified by removing explicit properties.

The HtmlWebpackPlugin configuration has been simplified by removing the filename and publicPath properties, allowing it to use defaults. This change works in conjunction with the new inline script plugin and the removal of the /ui endpoint handler mentioned in the PR summary.


68-68:

❓ Verification inconclusive

New plugin added to inline scripts.

The HtmlInlineScriptPlugin will embed JavaScript directly into the HTML file rather than keeping them as separate files. This reduces HTTP requests and simplifies asset delivery, which aligns with the PR objective.


🏁 Script executed:

#!/bin/bash
# Check if the UI server route handler has been removed as mentioned in the summary
rg -A 3 -B 3 "route handler for the `/ui` endpoint" --glob "*.ts"

Length of output: 171


Action Required: Verify the Removal of the UI Route Handler
The new plugin addition (i.e. new HtmlInlineScriptPlugin()) in the packages/transport-bridge/webpack/ui.webpack.config.ts file is correct and achieves the inlining of JavaScript as intended. However, the original shell command intended to confirm that the UI server route handler for the /ui endpoint was removed did not execute as expected. The error indicates that the pattern might not have been properly escaped, which prevented the intended verification.

Please re-run the verification using the following revised shell script to check for any remaining references to a /ui route handler in your TypeScript files:

#!/bin/bash
# Re-verify that no route handler for the `/ui` endpoint exists in the codebase.
rg --ignore-case -A 3 -B 3 'route handler.*\/ui' --glob '*.ts'

Manually confirm that this script does not produce any output before finalizing the merge.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mroz22 mroz22 merged commit be67d22 into develop Mar 6, 2025
72 checks passed
@mroz22 mroz22 deleted the transport-bridge-chores branch March 6, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-project This label is used to specify that PR doesn't need to be added to a project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants