Skip to content

Bundle server instead of making user download it #1

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

Merged
merged 1 commit into from
Feb 4, 2025
Merged

Bundle server instead of making user download it #1

merged 1 commit into from
Feb 4, 2025

Conversation

samestep
Copy link
Contributor

@samestep samestep commented Jan 31, 2025

Starting with version 1.61 from September 2021, VS Code supports publishing platform-specific extensions, allowing extensions like this one to bundle executables directly with the extension. For example, rust-analyzer has done this since December 2021: rust-lang/rust-analyzer#11053

This PR replaces all the user-facing download logic with just a package.sh script that gets run in GitHub Actions to build platform-specific extensions for the four platforms supported by this extension. (Note: to use the GitHub Actions workflow you'll need to create a VSCE_PAT secret, but if you prefer not to do that, I can also delete the .github/workflows/release.yml file from this PR.)

This has a couple benefits:

  1. Better user experience, since the user doesn't need to click a download button after installing the extension.
  2. When wat_server updates, VS Code will automatically prompt the user to update the extension in the same way as any other extension, rather than the user having to keep track of wat_server updates and run the Download Latest WebAssembly Language Tools action command themselves.
  3. Smaller total download, since the extension no longer depends on cross-spawn or got or jszip, halving the size of dist/extension.js.

I'm not aware of any downsides, since the download feature only supported these four platforms anyways, and this PR also builds a platform-agnostic VSIX to use in case someone is not on one of those four platforms but still wants to use this extension by installing wat_server manually.

@g-plane
Copy link
Owner

g-plane commented Feb 1, 2025

That sounds great! I don't need to maintain the logic of download any more. But, I have a question: do I need to publish a new version of this extension once wasm-language-tools released a new version?

@samestep
Copy link
Contributor Author

samestep commented Feb 1, 2025

Correct. So if it were me, both would go in the same repo so they could be triggered in the same release workflow. But if you keep this in a separate repo then you'd need to push a tag to trigger a new release.

@g-plane
Copy link
Owner

g-plane commented Feb 1, 2025

That won't be a big problem since we can write a workflow in wasm-language-tools repo to trigger release. This can be achieved in the future. (Do it manually in recent.)

I'm away from computer these days so I can't add token now, and once I add that token I will merge.

Copy link
Owner

@g-plane g-plane left a comment

Choose a reason for hiding this comment

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

Thanks!

@g-plane g-plane merged commit 26c271e into g-plane:main Feb 4, 2025
@samestep samestep deleted the bundle-server branch February 4, 2025 13:09
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