Added
- Field documentation: fields accept a
:docoption; the<!-- typed_ecto_schema: fields -->marker in your@moduledocis replaced at compile time with a list of every field, its typespec and its doc. Independently of the marker, the generatedt/0gets a@typedocwith the same fields list when the module doesn't define one (#68, closes #41) - Experimental: opt-in named types for
Ecto.Enumfields via theadditional_types: trueschema option or the globalconfig :typed_ecto_schema, additional_types: true— e.g.@type role() :: :admin | :userusable asPerson.role()(#63, closes #39) - Experimental: support for
polymorphic_embed'spolymorphic_embeds_one/2andpolymorphic_embeds_many/2behind a compile-time flag (config :typed_ecto_schema, polymorphic_embed: true), inferring the union of the:typesmodules without adding any dependency (#64, closes #40) - When both experimental features are enabled, polymorphic embed fields also get named types (element union for
_many)
Fixed
- Schema function options are no longer evaluated in the module body, so module aliases in pass-through options (e.g.
many_to_many(..., join_through: Book)) no longer create compile-time dependencies — matching plainEcto.Schema; guarded by a compiler-tracer regression test (#67, closes #38 and #26)
Docs
- New cheatsheet, restructured README/moduledoc, and an Experimental Features guide (#69)
Full changelog: https://github.com/bamorim/typed_ecto_schema/blob/0.5.0/CHANGELOG.md