Skip to content

Conversation

sjf
Copy link
Contributor

@sjf sjf commented Jul 18, 2025

cline-core can open the URLs directly without using the host bridge.

Use the npm module open.

Remove the openExternal implementation from the vscode-impls.

Update esbuild.js to ES6. I was not able to import the open module without making this change because of an imcompatibility between the module which is in CJS and the extension which is in ES6.

Related Issue

Test Procedure

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • ♻️ Refactor Changes
  • 💅 Cosmetic Changes
  • 📚 Documentation update
  • 🏃 Workflow Changes

Pre-flight Checklist

  • Changes are limited to a single feature, bugfix or chore (split larger changes into separate PRs)
  • Tests are passing (npm test) and code is formatted and linted (npm run format && npm run lint)
  • I have created a changeset using npm run changeset (required for user-facing changes)
  • I have reviewed contributor guidelines

Screenshots

Additional Notes


Important

Replace host bridge URL opening with npm open module and update build to ES6.

  • Behavior:
    • Replace host bridge method with npm open module for opening URLs in openExternal() in env.ts.
    • Remove openExternal RPC method from env.proto.
    • Update openInBrowser() in openInBrowser.ts to use new openExternal().
  • Build:
    • Rename esbuild.js to esbuild.mjs and update to ES6 imports to support open module.
    • Update package.json scripts to use esbuild.mjs.
  • Misc:
    • Remove openExternal.ts from vscode-impls.js and related files.
    • Add logging for errors in grpc-handler.ts.

This description was created by Ellipsis for 4957c87. You can customize this summary. It will automatically update as commits are pushed.

Copy link

changeset-bot bot commented Jul 18, 2025

⚠️ No Changeset found

Latest commit: f1baba1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sjf sjf changed the title Use npm open to open URLs in the external browser Use npm moduleopen to open URLs in the external browser Jul 18, 2025
@sjf sjf changed the title Use npm moduleopen to open URLs in the external browser Use npm modulesimple-open-http to open URLs in the external browser (instead of the host bridge) Jul 25, 2025
Copy link
Contributor

github-actions bot commented Jul 25, 2025

Coverage Report

Extension Coverage

Base branch: 46%

PR branch: 47%

✅ Coverage increased or remained the same

Webview Coverage

Base branch: 17%

PR branch: 17%

✅ Coverage increased or remained the same

Overall Assessment

Test coverage has been maintained or improved

Last updated: 2025-07-26T07:56:49.824945

Copy link
Contributor

@abeatrix abeatrix left a comment

Choose a reason for hiding this comment

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

I haven't tried the simple-open-url package before. but looking at their README.md:

This tool is used for a limited cross platform env usage, if you run command only on one platform, use the native open commands instead.

What error were you getting when you try to import open?

I tried replacing it with open and it worked for me if I update the path package to use the node protocol node:path

image

@sjf
Copy link
Contributor Author

sjf commented Jul 25, 2025

I haven't tried the simple-open-url package before. but looking at their README.md:

This tool is used for a limited cross platform env usage, if you run command only on one platform, use the native open commands instead.

We do need to run on multiple platforms.

What error were you getting when you try to import open?

I tried replacing it with open and it worked for me if I update the path package to use the node protocol node:path

image

I was just not able to get the import to work, any thing I tried to use from the open package was undefined.
I tried what you have here :/

@sjf
Copy link
Contributor Author

sjf commented Jul 25, 2025

I haven't tried the simple-open-url package before. but looking at their README.md:

This tool is used for a limited cross platform env usage, if you run command only on one platform, use the native open commands instead.

We do need to run on multiple platforms.

What error were you getting when you try to import open?
I tried replacing it with open and it worked for me if I update the path package to use the node protocol node:path
image

I was just not able to get the import to work, any thing I tried to use from the open package was undefined. I tried what you have here :/

import open from "open"
await open(url)
With this, when I load the extension I get this error
Screenshot 2025-07-25 at 13 46 50
Can you show me how you got it to work?

@sjf sjf changed the title Use npm modulesimple-open-http to open URLs in the external browser (instead of the host bridge) Use npm moduleopen to open URLs in the external browser (instead of the host bridge) Jul 26, 2025
@sjf sjf requested a review from abeatrix July 26, 2025 02:56
Copy link
Contributor

@abeatrix abeatrix left a comment

Choose a reason for hiding this comment

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

verified the sign in flow still works

sjf and others added 7 commits July 26, 2025 03:47
# Conflicts:
#	src/utils/env.ts

# Conflicts:
#	src/utils/env.ts
Update esbuild.js to ES6 and move to esbuild.mjs
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
@sjf sjf merged commit 19cb70d into main Jul 26, 2025
13 checks passed
@sjf sjf deleted the sjf-j17o branch July 26, 2025 08:10
li-yechao pushed a commit to li-yechao/cline that referenced this pull request Jul 27, 2025
… the host bridge) (cline#5013)

* Use npm `open` to open URLs in the external browser

# Conflicts:
#	src/utils/env.ts

# Conflicts:
#	src/utils/env.ts

* Change log statement

* Use the simple-open-url module to open URLs in the system browser.

Log failures of ProtoBus RPCs

* Remove vscode hostbridge handler for openExternal

* Rm unused imports

* Switch back to `open` module.

Update esbuild.js to ES6 and move to esbuild.mjs

* Update src/utils/env.ts

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* remove IS_DEV from e2e setup build

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: abeatrix <beatrix@cline.bot>
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