Conversation
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com> Co-authored-by: Ufuk Kayserilioglu <ufuk.kayserilioglu@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com> Co-authored-by: Ufuk Kayserilioglu <ufuk.kayserilioglu@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com> Co-authored-by: Ufuk Kayserilioglu <ufuk.kayserilioglu@shopify.com>
Member
|
About the user experience, is there a simple way we could detect if the developer forgot to invoke One idea I had, but that requires changing the interface, would be separating loading the app from loading custom compilers and having Tapioca deciding when to invoke Tapioca.eager_load_app do
require ...
end
Tapioca.load_dsl_compilers do
require ...
end
# And then, inside Tapioca
def execute
instance_exec(&Tapioca.eager_load_app_block)
load_dsl_defaults
instance_exec(&Tapioca.load_dsl_compilers_block)
endWDYT? |
paracycle
approved these changes
May 2, 2022
Member
paracycle
left a comment
There was a problem hiding this comment.
I have 2 problems with this but I think we should merge the PR so that we can iterate on those separately:
- I don't like the fact that we are basically exposing the
Dslcommand's surface area as a public API to the loader file. This will cause us problems down the line, since the command looks like an implementation detail to us devs, but will now be a public API where we can't change some method names/signatures anymore. Ideally, we would expose the surface area of a specific and custom object, something like aDslLoaderApiclass or something. - I am not a fan of the DSL language we are building inside the loader and have similar concerns with @vinistock about how easy it might be to make people shoot themselves in the foot.
However, we can iterate on these, so LGTM.
vinistock
approved these changes
May 2, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is unable to generate DSL RBIs for applications that are not Rails applications.
This PR provides a way for the user to pass a custom loader so Tapioca can load the application then run the RBI compilers.
To do so, one can create a file under
sorbet/tapioca/loader.rbwith the following content:Tests
See automated tests.