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

Do not use the Sorbet runtime in the default load path #214

Merged
merged 1 commit into from
Jul 19, 2022

Conversation

vinistock
Copy link
Member

Motivation

If people forget to use require: false when adding the ruby-lsp to their Gemfile, then lib/ruby-lsp.rb will be required by Bundler.

We shouldn't use anything related to the Sorbet runtime in this file, because that would mean we have to require sorbet-runtime and possibly pollute the application in development mode.

This is currently breaking in apps that do not use sorbet-runtime, because T.let is not defined.

Implementation

Ignored this file for the strict sigil cop and remove the T.let.

@vinistock vinistock added the bug Something isn't working label Jul 19, 2022
@vinistock vinistock requested a review from a team as a code owner July 19, 2022 17:57
@vinistock vinistock self-assigned this Jul 19, 2022
Copy link
Contributor

@Morriar Morriar left a comment

Choose a reason for hiding this comment

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

I'm surprised we do not have to change any require anywhere to not pull sorbet-runtime in the mix?

@vinistock
Copy link
Member Author

Our default require (lib/ruby-lsp.rb) doesn't actually require anything (not even dependencies like sorbet-runtime). All of our requires are in internal.rb, which is why when bundler does the default require, it breaks saying that T is undefined.

@vinistock vinistock merged commit 83d46f5 into main Jul 19, 2022
@vinistock vinistock deleted the vs/do_not_use_sorbet_runtime_in_default_load_path branch July 19, 2022 19:04
vinistock added a commit that referenced this pull request Jul 27, 2022
…default_load_path

Do not use the Sorbet runtime in the default load path
@shopify-shipit shopify-shipit bot temporarily deployed to production August 26, 2022 20:47 Inactive
andyw8 pushed a commit to andyw8/ruby-lsp that referenced this pull request Mar 2, 2024
…sbuild-0.15.7

Bump esbuild from 0.15.6 to 0.15.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants