Manweill / swagger-axios-codegen

swagger client to use axios and typescript
MIT License
306 stars 83 forks source link

support babel-plugin-import #7

Closed Manweill closed 5 years ago

Manweill commented 6 years ago

About support babel-plugin-import,What do you think

@kt81

kt81 commented 6 years ago

I have never used that library. I guess it will provide the ability to split a service classes? If so, I think it is nice.

Manweill commented 6 years ago

babel-plugin-import can reduce the bundle size significantly, depending on your usage of the library. Split service requires codegen to provide. In codegen v0.3, I will implement it. But, if split with service classes, the ref models will repeated appearance in service class; if split with class (includes definitions and service class), it will generate very many files, for example in my service ,it generate 1000+ files.

kt81 commented 6 years ago

Thank you for explanation. My service file has very fewer services and models than yours so I don't care about separating or not. But it is nice to have ability to separate service and reduce the bundle size, It think.

IMO the best way is separating file and babel-plugin-import support are implemented as OPTION.

(我不是很擅长英文和中文,所以如果我误解了这个意思,我很抱歉)