polymorphic_embed icon indicating copy to clipboard operation
polymorphic_embed copied to clipboard

Compile time dependencies between embedded schemas

Open crbelaus opened this issue 2 years ago • 0 comments

When using polymorphic_embeds_one and polymorphic_embeds_many this library creates compile time dependencies between the parent module and the polymorphic embed modules. This causes huge dependency graphs in which changing a file requires a recompilation of many others.

This same problem existed in Ecto some time ago as reported in elixir-ecto/ecto#1610. The Ecto team fixed this by disabling the lexical tracker for the association modules as shown in elixir-ecto/ecto#1670.

Given that Polymorphic Embed aims to mimic Ecto's embeds_one and embeds_many. Would it make sense to use the same approach as Ecto did to fix this issue?

crbelaus avatar Jun 27 '23 12:06 crbelaus