Skip to content

--async-exports option for type generation is not working #622

Open
@mschuwalow

Description

@mschuwalow

The bindgen code has a leftover todo that breaks async export generation for all world interface exports:

let is_world_export = false; // TODO

E.g. if I generate code for the following wit

package example:node-fetch;

interface simple-request {
  record response {
    /// User-provided name for a request
    url: string,

    /// Response body, converted to JSON
    response-json: string,
  }

  /// This function performs a GET request
  /// to the provided URL without supplying an query parameters or a body
  get-json: func(url: string) -> response;
}

world component {
 export simple-request;
}

Using

jco types wit-generated --async-mode jspi --async-wasi-exports  --async-exports 'example:node-fetch/simple-request#get-json' -o src/generated

The generated export is

/** @module Interface example:node-fetch/simple-request **/
export function getJson(url: string): Response;
export interface Response {
  url: string,
  responseJson: string,
}

instead of the expected async code

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions