postmanlabs / postmanlabs/postman-code-generators

Add support for QCObjects serviceLoader that is OOP oriented

Open
#147 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

codegen feature
Dominant language
JavaScript
Stars
1k
Forks
381
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.
It is needed an OOP oriented client in JavaScript to call microservices in the front-end side as well as the backend without the need to refactor the code.

Describe the solution you'd like
QCObjects is supporting that by the use of a serviceLoader helper that is wrapping the caller in the front-end as well as the backend using the same code pattern.

Additional context
Below is a code example that is working in the browsers as well as in node environment:

Class('MyTestService',Service,{
    name:'myservice',
    external:true,
    cached:false,
    method:'GET',
    headers:{'Content-Type':'application/json'},
    url:'https://api.github.com/orgs/QuickCorp/repos',
    withCredentials:false,
    _new_:()=>{
      // service instantiated
    },
    done:()=>{
      // service loaded
    }
});
// creating the OOP service client instance and loading it with serviceLoader at once
var service = serviceLoader(New(MyTestService,{
  data:{param1:1}
})).then(
  (successfulResponse)=>{
    // This will show the service response as a plain text
    console.log(successfulResponse.service.template);
  },
  (failedResponse)=>{

  });

QCObjects is being used by thousands of companies around the world since a few months ago (see npm stats ) and has been featured by British Herald as today, the most advanced framework for modern software development

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository files, tests, or entry points are named. Start by locating the JavaScript code-generator entry points and determine where support for the QCObjects serviceLoader pattern would belong; done means the requested OOP service client works in both browser and Node environments without requiring callers to refactor.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.