tapioca icon indicating copy to clipboard operation
tapioca copied to clipboard

Enhance loading during `tapioca gem`

Open KaanOzkan opened this issue 2 years ago • 0 comments

bin/tapioca gem X loads all the gems but it only regenerates RBIs for X. This could cause issues when X RBIs rely on definitions from another gem, Y. An example of this is in spoom v1.2.2 (X) where there's a new method override that'll be generated in spoom's new RBIs. The abstract method is defined in syntax_tree gem(Y).

A problem occurs if loading of the abstract method has started after we last generated RBIs for syntax_tree. The abstract method isn't defined in syntax_tree's RBIs and we end up with a typechecking error.

We could implement @paracycle's suggestion from https://github.com/Shopify/tapioca/issues/1562#issuecomment-1644801566

  • Track references to external constants
  • Identify which gems the constants belong to
  • Queue RBI generation for those gems.

KaanOzkan avatar Jul 21 '23 17:07 KaanOzkan