Closed hekike closed 8 years ago
@hekike I think it would be interesting to have only a single template for both browser and nodejs javascript.
@hekike Any progress on this? Does your fork pass all of the tests?
For me, there are two primary reasons for wanting to pre-generate the library: static builds for deployment and enabling the IDE to pickup on available commands. Browserify tends to bloat the size of the package and it confuses IDEs.
A better strategy would be to switch to the upcoming Fetch API or Popsicle and use native promises. All three have libraries/polyfill for Node and the major browsers.
As a convenience for browser users, we could add a third template that inlines the Fetch/Popsicle and promise polyfills.
@wcandillon no, unfortunately I also started to do a heavy refactor and added some features what we needed asap at our company.
The good news is that we are using the generated code for months, in production as well. The bad news is that I still need time to fix all of the tests.
what I added or changed:
+1 for bluebird and superagent.
I am using bluebird in my fork as well.
bluebird is very powerful, for example it allows to catch multiple predicate errors. Which is super handy.
It also has a compliant API. It have also deprecated "deferred's" in favor of spec compliant syntax. and some other cool stuff
@hekike @indolering @dciccale I started a PR for this: #104 .
I've been working on a branch to transform
swagger-js-codegen
fromrequest
tosuperagent
becausesuperagent
is able to run on both client and server sides. This would make it possible to bundle the output code with browserify/wepback and provide a client library as well.Is it something what you find interesting? Should i continue the work?
Progress: https://github.com/hekike/swagger-js-codegen/commits/feature/superagent