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

Add publishing step for dotnet language server #276

Merged
merged 1 commit into from
Jun 17, 2021

Conversation

gracegoo-stripe
Copy link
Contributor

This commit adds a new npm script target that calls the dotnet publish command to place all necessary libs into the dist/stripeDotnetLanguageServer folder which we can then access from the client. We are excluding the test project from being included in the publishing.

I also updated the task.json as well to use the npm script.

Note -- this did not need to be an npm script at all, we could have just added a bash script that has the same contents and called it, but I figured it'll just be easier to keep track of if all our build steps were in the same place.

Testing

  1. Made sure the language server can startup via the debugger launcher
  2. Packaged up the extension with vsce package, manually installed it, and made sure the language server can start up.

Copy link
Collaborator

@vcheung-stripe vcheung-stripe left a comment

Choose a reason for hiding this comment

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

LGTM

@gracegoo-stripe
Copy link
Contributor Author

I forgot to check the size of the extension afterwards and it's gone up from 2 to 10MB. I'm looking around to see if we can bring that down.

There are some optimization flags available with dotnet publish, but those are only available for self-contained applications. These allow us to include a runtime executable within the publishing (which would fix our other problem of acquiring the dotnet execuable at runtime), but we would need to make one for every platform in that case. I'll run a test tomorrow to see how the sizes would compare.

@gracegoo-stripe
Copy link
Contributor Author

gracegoo-stripe commented Jun 17, 2021

Okay, ran a test and here are the numbers:

  • Without the dotnet app: 2MB
  • With the app: 10MB
  • self-contained app (including the dotnet runtime) for linux-x64: 40MB
  • self-contained app for linux-x64 with trimming and single-file enabled: 22MB

So I'd say the self-contained option is not worth it. One is already still larger than the app and we'd need to ship with multiple self-contained apps which would increase the extension size even more.

I'll merge this version in

@gracegoo-stripe gracegoo-stripe merged commit 2079d86 into dotnet-server Jun 17, 2021
@gracegoo-stripe gracegoo-stripe deleted the gracegoo-dotnet-bundling branch June 17, 2021 18:29
gracegoo-stripe added a commit that referenced this pull request Jun 17, 2021
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