Enhancement: Use typescript "import type" syntax for type imports
chrischen opened this issue · comments
chrischen commented
Please excuse the old ReasonML syntax...
[@genType.import "mongodb"]
[@genType.as "ObjectId"]
type t;
This generates
import {ObjectId as $$ObjectId_t} from 'mongodb';
Which works, and is correct, but in some cases can cause cyclical imports if only types are needed (this is a third party library so it wouldn't happen, but can happen with own library).
This syntax would be better as it's only compile-time and stripped at runtime.
import type {ObjectId as $$ObjectId_t} from 'mongodb';
Cristiano Calcagno commented
Thanks, that's a nice suggestion.