Strict unions create a lot of new exported type names. This can cause name conflicts when they are imported into the index file.
The specific case I am running into is that one of my schemas has both an Attribute and AttributeType where Attribute is a union, and has a create an AttributeType union type, which conflicts with the thrift AttributeType.
I don't think this can be solved in a non-breaking way, but for v4, it would be nice if types were generated in a way that is less likely to have name collisions.
My proposal for this would be to have the index use namespace imports instead eg import * as Foo from ./Foo. and then do export { Foo } . Then when using a namespace you would could import * as Namespace from './path/to/namespace and then Do Namespace.Foo.Args or Namespace.Foo.Strict
Strict unions create a lot of new exported type names. This can cause name conflicts when they are imported into the index file.
The specific case I am running into is that one of my schemas has both an
Attribute
andAttributeType
whereAttribute
is a union, and has a create anAttributeType
union type, which conflicts with the thriftAttributeType
.I don't think this can be solved in a non-breaking way, but for v4, it would be nice if types were generated in a way that is less likely to have name collisions. My proposal for this would be to have the index use namespace imports instead eg
import * as Foo from ./Foo
. and then doexport { Foo }
. Then when using a namespace you would couldimport * as Namespace from './path/to/namespace
and then DoNamespace.Foo.Args
orNamespace.Foo.Strict