Make DSL compiler test helper work without needing an extra require #1963
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Currently Tapioca exports a DSL compiler test helper that is used by other app or gems to test their DSL compilers. However, the helper requires a lot of Tapioca DSL classes to be defined before it can be used. This is a problem because it means that the helper can't be used in isolation, without the rest of Tapioca. A common workaround for this is to start requiring "tapioca/internal" in the test file that uses the helper, but that ends up causing Sorbet runtime related behaviour changes due to the Sorbet runtime patches that that require pulls in.
Implementation
In order to fix this, all we need to do is to require "tapioca/dsl" which brings in only the DSL classes that the helper needs. This way, the helper can be used in isolation without needing to require "tapioca/internal" and without causing any Sorbet runtime related behaviour changes.
Tests
No new tests